User Guide
1324 Tween class
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
Tween.onMotionFinished event. Clicking a button called
forwardByFrame_btn calls the
Tween.stop() method to stop the animation, followed by
calling the
Tween.nextFrame() method. Clicking the button during the tweened animation
has the effect of stopping the animation and then moving forward by only a single frame.
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 is 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, 60, false);
myTween.onMotionFinished = function() {
myTween.start();
};
forwardByFrame_btn.onRelease = function() {
myTween.stop();
myTween.nextFrame();
};
Tween.onMotionChanged
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
tweenInstance.onMotionChanged = function() {
// ...
};