User Guide

1311
51
CHAPTER 51
Tween class
Inheritance (Root class)
ActionScript Class Name mx.transitions.Tween
The Tween class lets you use ActionScript to move, resize, and fade movie clips easily on the
Stage by specifying a property of the target movie clip to be tween animated over a number of
frames or seconds. The Tween class also lets you specify a variety of easing methods. Easing
refers to gradual acceleration or deceleration during an animation, which helps your
animations appear more realistic. For example, the options on a drop-down list component
you create might gradually increase their speed near the beginning of an animation as the
options appear, but slow down before the options come to a full stop at the end of the
animation as the list is extended. Flash provides many easing methods that contain equations
for this acceleration and deceleration, which change the easing animation accordingly.
The Tween class also invokes event handlers so your code may respond when an animation
starts, stops, or resumes or increments its tweened property value. For example, you can start a
second tweened animation when the first tween invokes its
Tween.onMotionStopped event
handler, indicating that the first tween has stopped.
Method summary for the Tween class
The following table lists methods of the Tween class:
Method Description
Tween.yoyo() Instructs the tweened animation to continue from its current
value to a new value.
Tween.fforward() Forwards the tweened animation directly to the end of the
animation.
Tween.nextFrame() Forwards the tweened animation to the next frame.
Tween.prevFrame() Directs the tweened animation to the frame previous to the
current frame.