Using The Tween Class - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Event
Tween.onMotionResumed
Tween.onMotionStarted
Tween.onMotionStopped

Using the Tween class

To use the methods and properties of the Tween class, you use the
new instance of the class. For example, to apply an instance of a tween to a movie clip object
on the Stage called
myMovieClip_mc
mx.transitions.Tween
import mx.transitions.Tween;
var myTween:Tween = new Tween(myMovieClip_mc, "_x",
mx.transitions.easing.Elastic.easeOut, 0, 300, 3, true);
Tween class parameters
When you create a new instance of a Tween class, you pass several parameters. You must
indicate the target movie clip object, what property of the movie clip the tween is to affect, the
range over which the object is to be tweened, and an easing method to use to calculate the
tweened property.
The constructor for the mx.transitions.Tween class has the following parameter names
and types:
Tween( obj:Object, prop:String, func:Function, begin:Number, finish:Number,
duration:Number, useSeconds:Boolean )
obj
The movie clip object that the Tween instance targets.
prop
A string name of a property in
func
The easing method that calculates an easing effect for the tweened object's property
values. See
"About easing classes and methods" on page 1314
begin
A number indicating the starting value of
tweened).
finish
A number indicating the ending value of
be tweened).
Description
Event handler; invoked when the Tween.resume() method is
called, causing the tweened animation to resume.
Event handler; invoked when the Tween.start() method is
called, causing the tweened animation to start.
Event handler; invoked when the Tween.stop() method is
called, causing the tweened animation to stop.
, you use the following code to create a new instance of
:
to which the values are to be tweened.
obj
new
(the target object property to be
prop
(the target object property to
prop
Using the Tween class
operator to create a
1313

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents