1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
/* importation de package */
import mx.transitions.* ;
import mx.transitions.easing.* ;
/* creation d'un clip(bouton) */
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextDepth());
mc.beginFill(0x0000FF);
mc.lineStyle(1,0x000000);
mc.moveTo(-50,-50);
mc.lineTo(50,-50);
mc.lineTo(50,50);
mc.lineTo(-50,50);
mc.lineTo(-50,-50);
mc.endFill();
/* gestion clique */
mc.onPress=function()
{
var twX:Tween = new Tween(mc, "_rotation", Elastic.easeInOut, 0, 360, 6, true);
twX.onMotionFinished = function( tw:Tween ):Void
{
trace("Fin de l'animation : on execute l'action");
};
};
/* positionnement du clip */
mc._x = Stage.width / 2;
mc._y = Stage.height / 2; |
Partager