Thursday, October 30, 2008

Tweening in AS3 Part II

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

var myTween:Tween=new Tween(test_mc,"x",Elastic.easeOut,0,300,3,true);

myTween.addEventListener(TweenEvent.MOTION_CHANGE,checkPos);
function checkPos(tevt:TweenEvent):void {
trace(test_mc.x);
}
myTween.addEventListener(TweenEvent.MOTION_FINISH,finished);
function finished(tevt:TweenEvent):void {
trace("done");
}

No comments: