I’m going to kick start my blog about Flash with the question that people asked me most of the time. Which tween engine should I use? I would say it’s going to be based on your own preference when it comes down to this. With Actionscript 3, the one that I used most of the time will be Tweener. It allows you to tween different sets of properties in one single line, such as:
Tweener.addTween(mc, {x:250, y:250, alpha: .5, time:1, transition:"easeInOutQuad"});
However, while I was working back at Neoganda, we worked mostly in AS2, therefore I was introduced with MC Tween, which is also developed by Zeh Fernando, who’s also the man behind Tweener. MC Tween is not a class file, so, all you need to do is just #include the as file on your first frame and you would never need to import it anymore. It is pretty simple to be called upon as it adds on properties to all the display objects. Instead of writing all the properties in one line like Tweener, this is how you would write to move the y position of an object.
Pretty straightforward eh? Recently, I’ve moved on to use GTween by Grant Skinner. It is still currently at its beta phase, but it is already looking really promising. GTween is built to be fast and small. It is also and Object Oriented Tween Engine that will best suits developers with its flexibility. How you would create this tween is by writing:
var myTween:GTween = new GTween(mc, 1, {x:250});
So you could then add event listeners to these tween to listen for onComplete events or such.
So as you can see, there’s a wide list of Tween enines that you could use, or you could even write your own tweens from scratch. These list of Tween engines are here as an option to make your life easier. I’ve came across this article a while ago, “Speed Test - Tween Engine Comparison Tool” that shows you the performance of different tween engines, apparently tweener is running really slow with TweenLite/TweenMax leading with its fast performance. However, it is also one of the tween engines that I haven’t get my hands on. Guess I’ll be looking into it and probably write a short tutorial and feedback about it a few days later. So for now, go hop on to it and run the test yourself so you could decide which suits you the most.
No matter which one you decide to use, the way to use and write them wouldn’t be that big of a difference. Therefore it wouldn’t be hard for you to hop on a new engine if you’re working on someone’s file who is using the other tween engine. So no worries on that and happy tweening.
Tags: grant skinner, gtween, mc tween, neoganda, speed test, Tween, tweener, tweenlite, tweenmax, zeh fernando
Posted in Flash | 1 Comment »