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
| import fl.transitions.Tween;
import fl.transitions.easing.Elastic;
import fl.transitions.TweenEvent;
var conteneur:Sprite = new Sprite();
addChild(conteneur);
var interpolation:Tween;
var toto:maClasse = new maClasse();
conteneur.addChild(toto);
interpolation = new Tween(toto, "scaleX", Elastic.easeOut,1 ,1, 2, true);
interpolation.addEventListener(TweenEvent.MOTION_FINISH, fin);
conteneur.addEventListener(MouseEvent.CLICK, clic, true);
function fin (evt:TweenEvent):void{
trace(evt.target); // affiche Tween
trace(evt.currentTarget.obj); // affiche maClasse
}
function clic (evt:MouseEvent):void
{
interpolation.continueTo(1.1, 2);
} |
Partager