|
Download |
|
import mx.transitions.Tween;
import mx.transitions.easing.*;
var RotateT:Tween = new Tween(my_mc, "_rotation",
Elastic.easeOut, 0, 360, 4, true);
RotateT.onMotionFinished = function() {
this.continueTo(0, 4);
} |
Note: Press
the "refresh" button in the browser to play the animation
again. |
The tween transition class is imported.
import
mx.transitions.Tween;
All the easing transitions are imported to the
........
import mx.transitions.easing.*;
A new tween is contructed named "xPositionT" and defined
using the tween class syntax:
Tween (object name, property, ease class, ,,,).
var RotateT:Tween = new Tween(my_mc, "_rotation",
Elastic.easeOut, 0, 360, 4, true);
A function is created that points towrds the rotation
tween. When the listener detect5s that the tween
has stopped the function is called.
RotateT.onMotionFinished = function() {
Inside the function the .. "contueTo"
this.continueTo(0, 4);
|