Tween Rotate in Actionscript 3.0
I Just discovered the Tween() class in AS3. It’s pretty awesome and I think I’ll be using this quite a bit. Basically to make something rotate, you use this:
var myTweenRotation1:Tween = new Tween(img1_mc, “rotation”, Strong.easeOut, 114, 184, 3, true);
And your movie clip img1_mc will rotate smoothly with easing and everything. As you can probably figure out, changing the “rotation” parameter to some other object property – say ‘”scaleX” and “scaleY” for scaling or “x” and “y” for position – makes this Tween class pretty powerful. I have yet to really explore all the options and parameters, but this Actionscript 3 Tweens Tutorial seems like it might come in handy.
Good luck.
August 10th, 2009 at 7:25 pm
And your movie clip img1_mc will rotate smoothly with easing and everything. As you can probably figure out, changing the “rotation” parameter to some other object property – say ‘”scaleX” and “scaleY” for scaling or “x” and “y” for position – makes this Tween class pretty powerful. I have yet to really explore all the options and parameters, but this Actionscript 3 Tweens Tutorial seems like it might come in handy.
August 19th, 2009 at 2:35 pm
Better yet, instead of using the classes that comes with Flash you should consider using the TweenLite library. It is faster and easier to use. I also made a tutotial about those here http://www.zedia.net/2008/actionscript-3-tweenlite-basic-tutorial/
Have fun