ActionScript 2.0 Components Language Reference |
|
|
|
| Tween class > Tween.prevFrame() | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
tweenInstance.prevFrame()
Nothing.
Method; plays the previous frame of the tweened animation from the current stopping point of an animation that was stopped. Use this method to play a tweened animation backwards one frame at a time after you use the Tween.stop() method to stop it.
|
NOTE |
This method may be used only on frame-based tweens. A tween is set to frame based at its creation by setting the |
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 a button called forwardByFrame_btn calls the Tween.stop() method to stop the animation, followed by calling the Tween.prevFrame() method. Clicking the button during the tweened animation stops the animation and then reverses it by only a single frame. Clicking the resumeTween_btn button calls the Tween.resume() method, and the tweened animation resumes. When you create the Tween instance, the useSeconds parameter is declared false to make the tween frame-based. This process is required to use the Tween.nextFrame() method. A movie clip instance named img1_mc, a movie clip instance named resumeTween_btn and a movie clip instance named reverseByFrame_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, 50, false);
myTween.onMotionFinished = function() {
myTween.start();
};
reverseByFrame_btn.onRelease = function() {
myTween.stop();
myTween.prevFrame();
};
resumeTween_btn.onRelease = function() {
myTween.resume();
};
|
|
|
|