ActionScript.org Flash, Flex and ActionScript Resources - http://www.actionscript.org/resources
[AS3]Using caurina Tweener
http://www.actionscript.org/resources/articles/902/1/AS3Using-caurina-Tweener/Page1.html
Tecsi Aron
Been working in IT since 2000, mostly in VB* till 3 years ago, when i migrated to Flash and AS3. Made several projects that combine AS3 with PHP. Mostly worked on games and Desktop applications. 
By Tecsi Aron
Published on July 7, 2009
 
Simple animations with Caurina Tweener

Some of you might be asking why use a third party tweening class when Flash has native code for it. The answers are:
  1. The native one has bugs. For example if you are simultaneously tweening 3 objects with native Tween class, from time to time you notice that one or more Tweens simply stop (at least this happened to me a lot while I was using the native class).
  2. You need 1 tween / tweened property. (If you move an object both on x and y you need two Tweens)
  3. It uses the same event model as everything in AS3(This is not necessarily bad, bit with Caurina Tweener you can not only specify the name of the handling function, you can also specify its parameters)
While Caurina Tweener:
  1. Works fine regardless of the Tweened objects.
  2. Gives better performance.
  3. You can tween multiple properties of 1 object with a single line of code
  4. It's built with static functions, meaning that you don't need an instance of the class every time you want to make a tween.
Here is a simple example:

The black box having instance name "box", and the initial alpha being 0.5 the code is:
[as]import caurina.transitions.Tweener;
Tweener.addTween(box,{x:300, y:100, alpha:1, time:2, transition:"linear"}); [/as]
see next page.....


Animation sequences are also much easer to make, as you no longer need to synchronize your tweens using events, for example:

There are practically two tweens one that changes x,y and alpha, it lasts 2 seconds as you can see in the code above, and one that changes the rotation.
The code is:
[as]import caurina.transitions.Tweener;
Tweener.addTween(box,{x:300, y:100, alpha:1, time:2, transition:"linear"});
Tweener.addTween(box,{rotation:50, time:1, transition:"linear",delay:2.5}); [/as]
No events no nothing just one extra parameter: "delay". As you can see it's set to 2.5, the length of the first tween is 2, so practicly the second tween starts 0.5 seconds after the first one finishes.
Still you may want to do something when your tween finishes playing, you accomplished this by 'addEventListener(Event.COMPLETE)' with tweener it's just another parameter as such:
[as]Tweener.addTween(box,{rotation:50, time:1, transition:"linear",delay:2.5, onComplete:doThis});
function doThis()
{
        trace("here");
} [/as]
doThis will be called when tween has completed. As you can see doThis doesn't have any parameters, wich might be good, but in case you do need parameters, that is easy to acomplish as well:
[as]Tweener.addTween(box,{rotation:50, time:1, transition:"linear",delay:2.5, onComplete:doThis, onCompleteParams:["hello world"]});
function doThis(s:String)
{
        trace(s);
} [/as]
NOTE: "hello world" can be replaced with a variable, or with multiple variables separated with comas. For example:
[as]
var nr1:Number=1;
var nr2:Number=2;
var nr3:Number=3;
Tweener.addTween(box,{rotation:50, time:1, transition:"linear",delay:2.5, onComplete:doThis, onCompleteParams:[nr1,nr2,nr3]});
function doThis(n1:Number, n2:Number, n3:Number)
{
        trace(n1+n2+n3);
} [/as]

You can download examples from here.
You can read the online documentation for Tweener here.
You can download Tweener from here.

Hope somebody will find this usefull,
Best regards.