Hi,
I have an interesting problem here that I can’t figure out. Here’s the problem:
This code works:
var xMoveTween:Tween = new Tween(this, “x”, Strong.easeOut, this.x, stage.mouseX, 3, true);
var yMoveTween:Tween = new Tween(this, “y”, Strong.easeOut, this.y, stage.mouseY, 3, true);
It moves my object to the position of the mouse. Now this following code does NOT work
var xMoveTween:Tween = new Tween(this, “x”, Strong.easeOut, this.x, stage.mouseX, 3, true);
xMoveTween.addEventListener(TweenEvent.MOTION_FINISH, moveToY);
function moveToY(event:TweenEvent):void {
var yMoveTween:Tween = new Tween(this, “y”, Strong.easeOut, this.y, stage.mouseY, 3, true);
trace(“interesting”);
}
As you can see, I want the object to move in the x direction, then once it’s done that I want it to move in the y direction instead of just doing both at once and going diagonal. One thing that is “interesting” is that the trace still spits out the word to the output window. But the object in the end has only moved to the x destination and never gets to the y. Any ideas on how to fix this? or an alternate way to make the object move in the x direction followed by the y?
icekube12jr