ActionScript 2.0 Components Language Reference |
|
|
|
| Tween class > Tween.onMotionResumed | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
tweenInstance.onMotionResumed = function() {// ...};
Event handler; invoked when the Tween.resume() method is called. Handling this event allows your code to react at the point at which the tweened animation was resumed.
The following example applies a tweened animation to the img1_mc movie clip. The animation is looped to play repeatedly from its starting point by calling the Tween.start() method from within an onMotionFinished event handler. Clicking a button called stopTween_btn calls the Tween.stop() method to stop the tweened animation at its current value. Clicking a button called resumeTween_btn calls the Tween.resume() method to resume the tweened animation from its stopping point. When the Tween.resume() method is called, the Tween instance invokes the onMotionResumed handler. A movie clip instance named img1_mc, a movie clip instance named stopTween_btn, and a movie clip instance named resumeTween_btn, are required on the Stage for this example:
import mx.transitions.Tween;
var myTween:Tween = new Tween(img1_mc, "_x", mx.transitions.easing.None.easeNone,0, Stage.width, 3, true);
myTween.onMotionFinished = function() {
myTween.start();
};
myTween.onMotionResumed = function() {
trace("onMotionResumed");
};
stopTween_btn.onRelease = function() {
myTween.stop();
};
resumeTween_btn.onRelease = function() {
myTween.resume();
};
|
|
|
|