ActionScript 2.0 Components Language Reference |
|
|
|
| Tween class > Tween.onMotionChanged | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
tweenInstance.onMotionChanged = function() {// ...};
Event handler; invoked with each change in the tweened object property that is being animated. Handling this event allows your code to react as the target movie clip's property that is being tweened increments to the next value.
In this example, a tween is applied to the img1_mc movie clip. With each increment of the tween to the _x property of the movie clip, the onMotionChanged event handler is invoked and displays a trace message indicating the tweened movie clip's new position. A movie clip instance named img1_mc is required on the Stage for this example:
import mx.transitions.Tween;
var myTween:Tween = new Tween(img1_mc, "_x", mx.transitions.easing.Elastic.easeOut,0, Stage.width-img1_mc._width, 3, true);
myTween.onMotionChanged = function() {
trace( this.position );
};
|
|
|
|