AS3 Motion Tween breaks

When I am doing a motion tween the tween sometimes breaks. Sometimes it’s on mouse over; other times it seems to just be random.

It only tweens part of the way and the TweenEvent.MOTION_FINISH never occurs.
(Sometimes it works fine.)

To test it, visit benbart.com/pcohen/ and click on Print->Consumer.

Here is the code:

function centerZoom(e:Event){

var currentX = this.x;
var currentY = this.y;
var newX =  -e.target.x;
var newY = -e.target.y;

var currentScale = parent.scaleX;
var newScale = 1/e.target.scaleX;

var centerX:Tween = new Tween(this, "x", Regular.easeOut, currentX,  newX, 1.2, true);
var centerY:Tween = new Tween(this, "y", Regular.easeOut, currentY,  newY, 1.2, true);

var centerZoomX:Tween = new Tween(parent, "scaleX", Regular.easeOut, currentScale, newScale, 1.2, true);
var centerZoomY:Tween = new Tween(parent, "scaleY", Regular.easeOut, currentScale, newScale, 1.2, true);

centerX.addEventListener(TweenEvent.MOTION_FINISH, onMotionFinished);

stage.removeEventListener(MouseEvent.MOUSE_OVER, unblur);
stage.removeEventListener(MouseEvent.MOUSE_OUT, reblur);
stage.removeEventListener(MouseEvent.CLICK, centerZoom);
stage.addEventListener(MouseEvent.CLICK, zoomOut);

}

Thanks for any help. I’m an AS3 virgin.

The default Adobe tween class is miserably bad. Use TweenLite, you’ll love it. It’s a lot easier to use, performance is a ton better, etc. It’s become more or less the standard, the default classes just aren’t so good.

Thanks. That actually fixed everything. So I guess the error was with Adobe’s Tween class. I like that they made a TweenFilter as well. That will make my life easier.