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.

Example

The following example returns the time value of a Tween instance. A movie clip instance named img1_mc, is required on the Stage for this example:

import mx.transitions.Tween;
var myTween:Tween = new mx.transitions.Tween(img1_mc, "_x", mx.transitions.easing.None.easeNone, 0, Stage.width-img1_mc._width, 10, false);
myTween.onMotionChanged = function() {
    var myCurrentTime:Number = myTween.time;
    var myCurrentDuration:Number = myTween.duration;
trace(myCurrentTime + " of " + myCurrentDuration);
};