in Actionscript 3

Choosing a Flash tweening library

If there was one area of Flash that is more controversial than 3D engines, it would have to be tweening libraries. I have recently seen some people on Twitter saying things like “Lee Brimelow now recommends gTween” and “I thought he used Tweener”. I also get a lot of emails asking for my advice on which is the best and fastest engine.

Since I started my tutorial site, I have used many different tweening engines to accomplish programmatic animation. I think the first engine that I used was Moses Gunesch’s awesome Fuse Kit. I was really disappointed to learn that there wasn’t an ActionScript 3 version when I finally decided to move to the new language. What was unique about Fuse was the way you could build up a sequence of tweens and have them run one after another. You can of course do the same with any engine using delays, but Fuse made the code much more readable. Moses is actually working on a new project for doing tweening called the Go ActionScript Platform.

Besides Fuse, I have also done a tutorial on Tweener, which was the first engine I used for AS3. The code is extremely simple to use and seems to run smooth for everything I have ever needed it for. It was developed by Zeh Fernando who is a very well respected member of the Flash community.

The next engine that I used was Jack Doyle’s TweenLite and I subsequently wrote a tutorial on using it for Layers Magazine. The word on the street was that this engine was the smallest and fastest around. This seems to indeed be the case after talking to many people in the community. But all of the differences in speed between these engines really only becomes apparent when you are animating thousands of objects. Most all of these engines will work similarly for most everything you’ll use them for.

The newest engine on the block is gTween which is being developed by Grant Skinner. He has just released beta version 4. It has a more traditional syntax compared to most engines as it doesn’t center around using static methods and also has a cleaner event model syntax as well. The first thing that drew me to it was some of the special features like smart rotation, which automatically finds the shortest route to a destination value. Another thing that is appealing to me about gTween is that fact that Grant is writing it, so I’m confident things like garbage collection will be handled correctly.

But the main point I want to make with this post is that you can’t go wrong with any of these engines. They are also similar enough to one another that moving between them is a piece of cake. In the end it comes down to which engine has the syntax that you prefer. Try them all and find that one that works for you. Also remember that to do a simple programmatic tween you can always fire off an enter frame event and kick it old school :-) .


Write a Comment



  1. Good writeup of what’s available. I’ve been using tweener since AS3. GTween looks very promising as the new leader of the pack. Thanks to all the dwvelopers who spend time on these libraries. I’ve seen Moses lobby for a unified library before, but a free market and competition has definitely been good for all.

  2. Also “don’t remember” that to do a simply programmatic tween you can always fire off an enter frame event and kick it old school :-).

    INDEED… no-one should do it the ‘old’ way… what a waste of time… lets all forget about enter frames for good. :)

  3. It is worth pointing out that Tweener and GTween are both open source and have been released under the MIT License. TweenLite (and family) use a different license with different restrictions.

  4. Just wanted to chime in and say that Jack has added the smart rotation to his engine as well, it’s called shortRotation. Also, with the stuff thats on the horizon for TweenMax and on top of the bezier tweening, i think it’s the superior engine.

  5. I totally agree – every engine has some pros and cons and you should test drive a few to see what works best for your work flow.

    There are a lot of issues to consider when choosing an engine like:
    – What features do I require?
    – Do I need an engine that supports AS2, AS3, or both?
    – How well does it perform?
    – How intuitive is the syntax?
    – Do I have any file size requirements?
    – What sequencing/grouping/management capabilities are available?
    – What is the author’s track record like for quick bug fixes and updates?
    – What resources are there for getting assistance if I need it?

    Also, I wanted to point out a few things about TweenLite:

    1) TweenLite has a more full-featured (and heavyweight) sibling, TweenMax. Same syntax, tons of features including “shortRotation” like gTween’s smartRotation. It also dispatches events in AS3 and offers bezier and filter tweening, etc.

    2) TweenLite isn’t centered around static methods – “” and “new TweenLite()” are both equally valid. Static methods can just protect newbies from garbage collection issues that occur when they forget to null variables (just like any other AS3 class).

    3) Speed is not only a factor when you’re tweening thousands of objects. It can be critical even with a single tween. Imagine a button with ROLL_OVER/ROLL_OUT events – when the user rolls over/off quickly, you want a fast engine in order to avoid slight stuttering as each tween instantiates. For those who are interested, there are some speed tests at Moses did some too:

    Grant, Moses, and Zeh are all brilliant, so you’re right – any of their engines are bound to be well-written. Lee, thanks for clarifying your position and encouraging folks to experiment with the various options. On behalf of the community, thanks for all the great educational resources you give us.

    Happy tweening!

  6. They’re mostly tha same all over, but it’s the special features that make the difference: like a per-tween pause-functionality (instead of a pauseAll or even nothing). Also plain old robustness is worth it: ive seen some versions of popular tweening engine’s that block garbage collection on every object you tweened and even Go had some crazy bugs.

  7. I think they are all great. I have been using Tweener for a while and love it but now that I see how GTween does not relay on static methods I am considering switching.

    Thanks Lee

  8. I’ve been using Twease since it let’s me do stacking animations just like fuse kit plus is about 2k’s, perfect for doing precious banners.

  9. I’ll always stick with whatever is the fastest and right now TweenLite holds that title.

    btw lee, is your ‘pimp my eclipse’ series over? I was really enjoying those..

  10. @Jack You rock man! I hope you got a chance to see the Layers article I did on TweenLite.

    I also just want to reiterate that in regards to GC, I have no reason to think that other engines aren’t doing it properly. Basically I have Tweener, TweenLite, and gTween in my global AS folder and just go through phases with which one I use. I also occasionally decompile agencies’ sites to see what libraries they use and they differ from project to project too. I guess we should just feel lucky that there are so many good options to choose from :-) .

  11. Indeed, nice post, and something I’ve always agreed on. And heck, maybe I’m a little late on this, but I think we all have Lee to thank for not only for introducing us all to a number of frameworks and features available in actionscript (the few libraries mentioned on this post are just a small part of that!) but for doing so in a pretty neutral context, without taking sides or being overly impressed with something just because it’s new. Makes it much more easier for people to decide by themselves, or, in case of libraries with similar goals, switching when the switch time arrives.

    So, thanks for everything Lee! You’re a one-man actionscript army.

  12. In AS2 days, I was a diehard fan of Ladislav Zigo’s Tweening prototypes. I’ve also used the amazing Fusekit on a number of occasions.
    I first discovered Tweenlite years ago on Flashcoders when I was searching for a lightweight alternative for use in banner ads.
    I’ve been a fan ever since then and have met few developers as dedicated and supportive of their users as Jack.

  13. I exclusively used MC Tween for AS2, but since AS3 was released I began using Tweener both for that and for AS2, and in the last few months I’ve switched from that to TweenLite.

    I found the syntax of Tweener and Tweenlite (which are VERY similar) to be disorienting at first after coming form MC Tween, but now I wouldn’t go back.

    As for speed, I wouldn’t have known the difference between Tweener and TweenLite until my first large scale project in AS3. I had been doing a lot of work with Papervision3D and was looking to improve performance, and switching from Tweener to TweenLite made a DRAMATIC difference.

  14. Nice overview of whats out there, and whats up and coming.

    I would definitely have to recommend the TweenLite / TweenMax family to anyone as well and have been using it for the past year now. One of the greatest things I’ve noticed about this library is the constant barrage of cool updates that keep coming out.

    Big thanks to everyone out there making stuff that works and helps us all.

  15. This is a fantastic post, and couldn’t have come at a better time. I’ve been looking in to various tween engines of the past months and decided that the next time I have a free chunk of time I was going to try and download as many as possible and try to create some effects. Then write up a little post on my simple findings. Just how easy and intuitive the engine is to use, speed, fileweight etc.

    Having this create discussion afterwards has also been helpful as I’ve discovered one or two more tween engines that I can have a little play with.

    It mostly depends on the effects you are trying to achieve as to which tween engine you want, the sites I often end up producing generally have very simple animation that needs to be fast and smooth but not overly complicated. For this TweenLite has been my weapon of choice for a while now.

  16. My 2¢:
    Though I’m a huge fan of just about everything Grant has written, I’ve not regretted a single use of TweenMax/Lite since I discovered it 6 months ago and it is my first choice for any programmatic animation.

    Its syntax makes it super simple to use, and its util classes, which statically type all the parameters you might have trouble remembering, are da bomb. Possibly most importantly, Jack updates it regularly to add things like groups (thank you!), so you can be sure that if someone introduces a cool idea it’ll make its way into TweenMax.

  17. I’ve used all of the aforementioned tween classes from Laco, Zeh, Grant, Senocular and even Ryan Taylor’s notable elegant OOP package boostworthy ( – but to be honest, I’ve been an avid user of TweenLite for the past year, and I’ve grown from using the AS2 version to the AS3 version. It:

    1. simply performs much better than any of the other packages listed above
    2. is modular such that you can package up a lightweight version (TweenLite) or a full-featured package.
    3. contains syntax that is extremely concise, especially when comparing a normal tween to its sequencing capabilities.
    4. has amazing garbage collection
    5. features decent comparison benchmark tests on an ongoing basis
    6. has the coolest functionality to tween objects through bezier points
    7. most importantly, has well-formatted documentation

    While I have no doubt of Grant Skinner’s capability to release an above-all winner for tweening, should it succeed, it would most likely be implemented by Adobe for the CS5 release, just as Grant’s team is responsible for crafting most of the AS3 components we see in Flash. When and if that happens, perhaps I’ll give it a shot – but in the meantime Jack, many, many thanks for writing an impeccable tween package. Keep up the great work!

  18. Also i would like to introduce another Tween engine that performs better than TweenMax. That is named Tweensy and available in google codes. Its as3 version and uses less memory and processor resources.

  19. Tinku TR, I’d highly recommend doing your own speed comparison between Tweensy and TweenLite/Max rather than going by the author’s claims or his speed tests (which don’t have source code posted yet). I know of several developers who have done so and discovered quite a different story in real-world scenarios (literally 2fps vs 36fps in TweenLite’s favor). I think Shane is working hard on ironing out the kinks, though, and Tweensy certainly has lots of features, so I have every reason to believe it will shape up to be a very capable engine. You may also want to look into what you’re required to do in order to get the speed benefits that his tests showcase – the tradeoffs may not be acceptable to you. If they are, however, you could accomplish similar things with a TweenLite/Max plugin – the upcoming release of TweenLite/Max uses a plugin model that makes it more flexible and even faster than ever.