Wwwebber's Blog

Actionscript 3 Tween Library Skinner’s Gtween vs Greensock’s tweenlite

Posted in actionscript 3 by wwwebber on July 5, 2010

Just wanted to add a little extra feed back for anyone who is currently trying to decide on an Actionscript 3 tween library. There are many other to choose from. I spent some time over the last month playing with both Grant Skinner’s GTween library and GreenSock’s TweenLight library . In a nutshell, you can’t go wrong with either one. Both are awesome and I’m glad someone did almost all that heavy lifting!

However, after using both libraries over the course of the development of my most recent online maths games Rj The Robot on the topic of how to combine like terms.

First off, why both libraries ROCK!
-Awesome levels of customization of tween types (sinusodal, Bounce etc..) the differences here are small. At the time of this post, Greensock has some that the GTween library does not .
– Optimized performace.

How they Differ

Object Model
Greensock— You can use either static based methods to create tweens or use good old OOP to create tween objects.
GTween –it uses an object model, though a static based interface is also available

ie–they are pretty much the same here.

Greensock wins this–it comes with an awesome component that let’s you visualize tweens and will actually output the code needed to create the tween! Go Greensock (see what I mean here)
GTween–Do not think anything like this is provided.

Greensock– TweenLite does not include an event system. However, if events are important to you then you just use GreenSock’s TweenMax (also free).
GTween– has a great event system.

Error reporting
Greensock– Hands down wins in the experiments I ran. If you pass Greensock a null object, it will throw an Error reporting the null reference.
GTween– In my tests, Gtween silently did nothing when I tried to tween a null object.
The winner here is clearly the Greensock library. Addendum: It turns out there is a reason for Gtween accepting null objects –read comments below.  That  said, Greensock allows the same chaining of events but reports null pointers.

In the end, you really can’t go wrong with either library. They both support object oriented syntax, chaining of tweens,and event dispatching and listening (Greensock only does this with the TweenMax..which is also free). Greensock does have a few extra tween types , the awesome visualizer as well as some amazing plugins –all of which led me to go with using Greensock.

If I you know of any other differences that I missed (and I know there must be many), please fire off a quick comment.


6 Responses

Subscribe to comments with RSS.

  1. […] I was looking through different tweening engines and found a great post by Wwwebber comparing gTween and Greensock.  The article is a great comparison piece.  But one of the factors (kind of the deciding factor) […]

  2. Grant Skinner said, on November 13, 2010 at 4:15 am

    The intent of GTween is definitely not to compete directly with TweenLite, however, to clarify one point – GTween intentionally works with a null target, it allows you to set up empty tweens and either react to their change events or use them as delays in chained nextTweens.

  3. Jack Doyle said, on November 15, 2010 at 5:34 pm

    Just to clarify, the GreenSock classes are equally object-oriented. A lot of people have the mistaken impression that they must use the static to() or from() methods to create their tweens – not true. Those are just convenience methods that help shield users from garbage collection chores. But you are welcome to create tweens like this:

    var tween:TweenLite = new TweenLite(mc, 1, {x:100});

    And then you can do stuff with that object like:

    tween.currentTime = 0.5;

    Like Grant said, the intention with GTween wasn’t to compete with GreenSock stuff – he has actually been quite supportive of TweenLite and served as an adviser during the development of v11. I have huge respect for him. He has positioned GTween as more of an experimental library that was built for his personal needs. Then he generously shared it with the community in case folks found it useful. Consequently, there isn’t a commitment to ongoing support and development like there is with GreenSock’s platform (dedicated forums at http://forums.greensock.com), but that’s in perfect keeping with Grant’s stated objectives. See his post called “GTween V2: What About TweenLite?” on his site for more details.

    There are some other differences related to management of overlapping tweens, plugins that are available to make tweening particular types of objects/properties easier, and several other features, but my primary objective in this post was to clear up the misunderstanding about TweenLite/Max not using an object-oriented syntax.

  4. wwwebber said, on November 15, 2010 at 8:04 pm

    Yes, it’s been some time since I wrote this post, and I now use the object oriented syntax of Tweenlite. There are quite a few other cool features of the library that I also didn’t know about originally–just as I’m sure GTween has many cool features beyond what I know about.

    Although I did use the word ‘vs’ in the title, I am not attributing an intent to compete to either of the libraries authors. I don’t think it really matters why someone made a publicly available library or whether or not they are attempting to compete with some else’s library–which, I understand, is not the case here. That is totally fine and, in my mind, is beside the point. If someone makes a ‘personal’ library but makes it public and, if that library, performs the same basic functionality as another library–a comparison is natural– and hopefully also useful for developers who don’t want to spend time experimenting with two libraries before committing to using one.

    The big picture in my mind is that developers are lucky to be able to choose between such high quality libraries.

  5. Jack Doyle said, on November 15, 2010 at 8:29 pm

    Fair enough, wwwebber 🙂 I didn’t mean to complain about your post at all – just trying to clarify a few things. I really appreciate you posting about this anyway, and I’m thrilled that you have been using GreenSock stuff (I should of mentioned that in the previous post). Just so folks don’t get the wrong impression about the object-oriented issue, it’d be swell if you corrected the original post (up to you though – it’s your blog). Again, thanks for sharing. And happy tweening!

  6. wwwebber said, on November 15, 2010 at 8:52 pm

    No worries.
    Done and thanks for the awesome library!

Comments are closed.

%d bloggers like this: