Tween Bug in AS3?

Hi All,

I am using the AS3 tween class to make some animation controlled by AS3. My Scale method is something like this :


public function animateToScale(obj:Object):void {
myMC = obj.mc == undefined ? this : obj.mc;
var t = obj.duration;
var start = obj.start;
var end = obj.end;
var animType = obj.animType == undefined ? Linear.easeIn : obj.animType;
var myTween1:Tween = new Tween(myMC, “scaleX”, animType, start, end, t, true);
var myTween2:Tween = new Tween(myMC, “scaleY”, animType, start, end, t, true);
myTween1.addEventListener(TweenEvent.MOTION_FINISH, onTweenFinish, false, 0);
myTween1.addEventListener(TweenEvent.MOTION_STOP, onTweenStop, false, 0);
myTween1.addEventListener(TweenEvent.MOTION_START, onTweenStart, false, 0);
}
public function onTweenStart(event:TweenEvent) {
trace("on Motion started == ");
}
public function onTweenFinish(event:TweenEvent) {
trace("on Motion finished == " + myMC);
}
public function onTweenStop(event:TweenEvent) {
trace("motion stopped == " + event.target.time + " :: " + event.target.position + " :: " + event.target.duration + " :: " + myMC);
}

This is inside my animator class. And my other custom classes extends this class to have the animation.

Now I have a big movieclip which is BigWheel class and it extends my animator class. When I call animateToScale on this movieclip, I observe a strange thing. Out of every 2/3 attempts, it is failing once. The execution at flash player will stop totally and the animation at the half way point. there won’t be any events called, like onTweenStart or onTweenStop.

This is creating a major problem for me. I have used the same logic in AS2 and it always worked fine for me. Sometimes I used to get some jerk when CPU usuage is high, but it never used to break the code.

Please help me out.

thanks in advance.