I have a tween like this :
new Tween(myObject, "x",null,nowPosition,finalPosition,time,true);
sometween.start();
Now when the tween has not finished and is somewhere in the middle and the final position changes. I want this tween to be modified so instead of moving to its already defined postion the object goes to开发者_StackOverflow the final position. Any ideas?
There are many ways to achieve that, but the lazy thing that comes to mind is using the continueTo() method, assuming you're using fl.transition.Tween.
e.g.:
import fl.transitions.Tween;
var nowPosition:Number = 0;
var finalPosition:Number = 200;
var time:int = 3;
var sometween:Tween = new Tween(myObject, "x",null,nowPosition,finalPosition,time,true);
sometween.start();
stage.addEventListener(MouseEvent.MOUSE_DOWN, update);
function update(event:MouseEvent):void {
sometween.continueTo(mouseX,.2);
}
HTH, George
精彩评论