User Guide
1336 Tween class
Example
The following example applies a tweened animation to the _x property of the img1_mc movie
clip
. A stopTween_btn movie clip’s onRelease() handler calls the Tween.stop() method to
stop the tweened animation and a
resumeTween_btn movie clip’s onRelease() handler calls
the
Tween.resume() method to resume the animation from a stopped position. 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, 8,
true);
myTween.onMotionFinished = function() {
myTween.start();
};
stopTween_btn.onRelease = function() {
myTween.stop();
};
resumeTween_btn.onRelease = function() {
myTween.resume();
};
Tween.time
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
tweenInstance.time
Description
Property (read-only); the current number of seconds that have passed within the duration of
the animation if the
useSeconds parameter was set to true when creating the Tween
instance. If the
useSeconds parameter of the animation was set to false, Tween.time
returns the current number of frames that have passed in the Tween object animation.