Tween.yoyo() - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Tween.yoyo()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
tweenInstance.yoyo()
Returns
Nothing.
Description
Method; instructs the tweened animation to play in reverse from its last direction of tweened
property increments. If this method is called before a Tween object's animation is complete,
the animation abruptly jumps to the end of its play and then plays in a reverse direction from
that point. You can achieve an effect of an animation completing its entire play and then
reversing its entire play by calling the
Tween.onMotionFinished
Tween.yoyo method does not begin until the current tweened animation is complete. See
Tween.onMotionFinished
Example
In the following example, a handler is triggered by the
tells the Tween instance to animate the
the
method. The result is a movie clip that moves from the left of the Stage to
Tween.yoyo()
the right and then reverses direction, moving from right to left in an animation loop. A movie
clip instance named
img1_mc
import mx.transitions.Tween;
var myTween:Tween = new Tween(img1_mc, "_x",
mx.transitions.easing.None.easeNone,0, Stage.width, 4, true);
myTween.onMotionFinished = function() {
myTween.yoyo();
};
1338
Tween class
Tween.yoyo()
event handler. This process ensures that the reverse effect of the
on page
1325.
img1_mc
, is required on the Stage for this example:
method within a
Tween.onMotionFinished
movie clip in a reverse direction by calling
event and

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents