I have a switch statement that is a part of the tween effects found on the header of http://gfxcomplex.com/blog.
the problem is this case will change the rotation of a sprite and then tween it to zero. The funny thing is some times (“not all the time”) some of the tween stop in the middle and do not complete leaving the sprite with a rotation somewhere in the middle of 180 to 0. My question is, is there something in my code that could be the reason for this or is this a bug?? :q:
You may have to watch the header for a long time to see this bug happen as it seems to be more a fluke then a true code bug.
case 7 :
var u:uint = 0;
test1.getChildAt(0).rotation = 180;
test1.getChildAt(1).rotation = 180;
test1.getChildAt(2).rotation = 180;
test1.getChildAt(3).rotation = 180;
test1.getChildAt(4).rotation = 180;
intervalId = setInterval(function myFunction(){
myTween1 = new Tween(test1.getChildAt(u), "rotation", Bounce.easeOut, 180, 0, 3, true);
u++;
if(u == 5){
clearInterval(intervalId);
}
},
150);
break;