Tweening with ActionScript 3
Dowload the above example here.
Using the Timeline isn’t the only way to animate an Object in Flash. There are several ActionScript Tweening Libraries that you can import and use. Attached is an example of using Tweener to tween the x and y properties of a ball. Notice that the caurina folder is in the same directory and the tweener.fla file. This is so the tweener.fla file can find the Tweener ActionScript files using the caurina.transitions.* package definition.
Here’s how you import tweener:
import caurina.transitions.*;
And to tween parameters of an Object:
Tweener.addTween(ball, {x:0, y:0, transition:"easeOutQuad", time:1, delay:.4});
The first parameter you pass to the addTween method is the instance name of the MovieClip (or DisplayObject) that you want to tween. The second parameter that you pass, is a generic Object that describes what to tween, how long to take for the tween (in seconds), and what type of easing equation to use. The transition property defines the type of easing equations to use, Tweener easing equations can be seen here. There are several optional parameters that you can use to do things like delay a Tween, or call a function before, or after a tween is completed. You can see a full list of Tweener Parameters here.
See the Tweener documentation on Google Code for more on what you can do with Tweener.