Ciao a tutti, scusate se il titolo non è molto chiaro, ma mi sono appena svegliato e non mi veniva niente di meglio xD!
Comunque, ho realizzato questo "menu" rotante, che ora per testarlo ha tutti i bottoni uguali.
Questo menu rotea su un'ellissi, ma non riesco a gestire la profondità dell'ultimo item del menu.
Se fate fare almeno un giro al menu, vi accorgerete che ad un certo punto c'è una clip che si comporta in modo scorretto.
Per aiutare nella comprensione, vi posto il codice:
Grazie a tutti in anticipo! Ciao!codice:// Imposto il centro dell'ellissi var centroX:Number = this.width / 2; var centroY:Number = this.height * 0.6; var mousePos = ( ( this.mouseX - centroX ) / 100 ); var angle:Number = menu.length(); function on_enter_frame(e:Event):void { if ( this.mouseY < this.movAreaSensibile.y ) { mousePos += 0.2; } else { if ( ( ( this.movAreaSensibile.mouseX - centroX ) / 100 ) > 2 ) { mousePos += 2; } else if ( ( ( this.movAreaSensibile.mouseX - centroX ) / 100 ) < -2 ) { mousePos -= 2; } else { mousePos += ( ( this.movAreaSensibile.mouseX - centroX ) / 100 ); } } for ( var i:Number = 0; i < playerini.length(); i++ ) { var depth:Number = ( ( mousePos + ( (360 / angle) * i ) ) * Math.PI ) / 180; menu.getItemByIndex(i).x = centroX - ( Math.sin( depth ) * 430 ) - (menu.getItemByIndex(i).width / 2); menu.getItemByIndex(i).y = centroY + ( Math.cos( depth ) * 130 ); menu.getItemByIndex(i).scaleX = ((100 + ( Math.cos( depth ) * 50 )) / 100); menu.getItemByIndex(i).scaleY = ((100 + ( Math.cos( depth ) * 50 )) / 100); if ( i != (menu.length() - 1) ) { // gira in senso orario if ( Math.sin(depth) > 0 ) { this.movPlaylist.setChildIndex(menu.getItemByIndex(i), 0); } // gira in senso anti-orario else { this.movPlaylist.setChildIndex(menu.getItemByIndex(i), this.movPlaylist.numChildren - 1); } } } }
Ciamiz

Rispondi quotando