Tween.resume()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

tweenInstance.resume()

Returns

Nothing.

Description

Method; resumes the play of a tweened animation that has been stopped. Use this method to continue a tweened animation after you have stopped it by using the Tween.stop() method.

NOTE

This method may be used only on frame-based tweens. A tween is set to be frame based at its creation by setting the useSeconds parameter to false.

Example

This 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 a handler triggered by the onMotionFinished event. Clicking the stopTween_btn button calls the Tween.stop() method to stop the tweened animation at its current value. Clicking the resumeTween_btn button calls the Tween.resume() method to resume the tweened animation from its stopping point. 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, -img1_mc._width, Stage.width, 3, true);

myTween.onMotionFinished = function() {
    myTween.start();
}; 

stopTween_btn.onRelease = function() {
     myTween.stop();
};
resumeTween_btn.onRelease = function() {
     myTween.resume();
};