| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
The Animator class applies an XML description of a motion tween to a display object.
The properties and methods of the Animator class control the playback of the motion,
and Flash Player broadcasts events in response to changes in the motion's status.
The Animator class is primarily used by the Copy Motion as ActionScript command in
Flash CS3. You can then edit the ActionScript using the application programming interface
(API) or construct your own custom animation.
If you plan to call methods of the Animator class within a function, declare the Animator
instance outside of the function so the scope of the object is not restricted to the
function itself. If you declare the instance within a function, Flash Player deletes the
Animator instance at the end of the function as part of Flash Player's routine "garbage collection"
and the target object will not animate.
motion
public var autoRewind:Boolean = false| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Sets the animation to restart after it finishes.
isPlaying:Boolean [read-only]
| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Indicates whether the animation is currently playing.
Implementation public function get isPlaying():Booleanmotion:Motion [read-write]
| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
The object that contains the motion tween properties for the animation.
Implementation public function get motion():Motion public function set motion(value:Motion):voidpublic var orientToPath:Boolean = false| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Sets the position of the display object along the motion path. If set to true
the baseline of the display object orients to the motion path; otherwise the registration
point orients to the motion path.
public var positionMatrix:Matrix| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
The Matrix object that applies an overall transformation to the motion path.
This matrix allows the path to be shifted, scaled, skewed or rotated,
without changing the appearance of the display object.
public var repeatCount:int = 1| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Number of times to repeat the animation.
Possible values are any integer greater than or equal to 0.
A value of 1 means to play the animation once.
A value of 0 means to play the animation indefinitely
until explicitly stopped (by a call to the end() method, for example).
The default value is 1.
See also
target:DisplayObject [read-write]
| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
The display object being animated.
Any subclass of flash.display.DisplayObject can be used, such as a MovieClip, Sprite, or Bitmap.
Implementation public function get target():DisplayObject public function set target(value:DisplayObject):voidSee also
time:int [read-write]
| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
A zero-based integer that indicates and controls the time in the current animation.
At the animation's first frame time is 0.
If the animation has a duration of 10 frames, at the last frame time is 9.
Implementation public function get time():int public function set time(value:int):voidpublic var transformationPoint:Point| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
The point of reference for rotating or scaling a display object. The transformation point is
relative to the display object's bounding box.
The point's coordinates must be scaled to a 1px x 1px box, where (1, 1) is the object's lower-right corner,
and (0, 0) is the object's upper-left corner.
public function Animator(xml:XML = null, target:DisplayObject = null)| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Creates an Animator object to apply the XML-based motion tween description to a display object.
Parameters | xml:XML (default = null) — An E4X object containing an XML-based motion tween description.
|
| |
| target:DisplayObject (default = null) — The display object using the motion tween.
|
See also
public function end():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Stops the animation and Flash Player goes immediately to the last frame in the animation sequence.
If the autoRewind property is set to true, Flash Player goes to the first
frame in the animation sequence.
See also
public static function fromXMLString(xmlString:String, target:DisplayObject = null):Animator| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Creates an Animator object from a string of XML.
This method is an alternative to using the Animator constructor, which accepts an E4X object instead.
Parameters
| xmlString:String — A string of XML describing the motion tween.
|
| |
| target:DisplayObject (default = null) — The display object using the motion tween.
|
Returns | Animator — An Animator instance that applies the specified xmlString to the specified target.
|
See also
public function nextFrame():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Advances Flash Player to the next frame in the animation sequence.
public function pause():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Pauses the animation until you call the resume() method.
See also
public function play():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Begins the animation. Call the end() method
before you call the play() method to ensure that any previous
instance of the animation has ended before you start a new one.
See also
public function resume():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Resumes the animation after it has been paused
by the pause() method.
See also
public function rewind():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Sets Flash Player to the first frame of the animation.
If the animation was playing, it continues playing from the first frame.
If the animation was stopped, it remains stopped at the first frame.
public function stop():void| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Stops the animation and Flash Player goes back to the first frame in the animation sequence.
See also
Event Object Type: fl.motion.MotionEventMotionEvent.type property = fl.motion.MotionEvent.MOTION_END| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when the motion finishes playing,
either when it reaches the end, or when the motion has
been interrupted by a call to the stop() or end() methods.
Indicates that the motion has stopped,
whether by an explicit call to
Animator.stop() or
Animator.end(),
or by reaching the end of the Motion instance.
The properties of the event object have the following values:
| Property | Value |
|---|
bubbles | false |
cancelable | false |
currentTarget | The object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The object that dispatched the event;
it is not always the object listening for the event.
Use the currentTarget property to always access the
object listening for the event. |
Event Object Type: fl.motion.MotionEventMotionEvent.type property = fl.motion.MotionEvent.MOTION_START| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when the motion starts playing.
Indicates that the Motion instance has started playing.
The properties of the event object have the following values:
| Property | Value |
|---|
bubbles | false |
cancelable | false |
currentTarget | The object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The object that dispatched the event;
it is not always the object listening for the event.
Use the currentTarget property to always access the
object listening for the event. |
Event Object Type: fl.motion.MotionEventMotionEvent.type property = fl.motion.MotionEvent.MOTION_UPDATE| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when the motion has changed and the screen has been updated.
Indicates that the Motion instance has changed and the screen has been updated.
The properties of the event object have the following values:
| Property | Value |
|---|
bubbles | false |
cancelable | false |
currentTarget | The object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The object that dispatched the event;
it is not always the object listening for the event.
Use the currentTarget property to always access the
object listening for the event. |
Event Object Type: fl.motion.MotionEventMotionEvent.type property = fl.motion.MotionEvent.TIME_CHANGE| Language Version : | ActionScript 3.0 |
| Runtime Versions : | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when the Animator's time value has changed,
but the screen has not yet been updated (i.e., the motionUpdate event).
Indicates that the Animator instance's
time value has changed,
but the screen has not yet been updated (Flash Player has not dispatched the
motionUpdate event).
The properties of the event object have the following values:
| Property | Value |
|---|
bubbles | false |
cancelable | false |
currentTarget | The object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget. |
target | The object that dispatched the event;
it is not always the object listening for the event.
Use the currentTarget property to always access the
object listening for the event. |
© 2004-2008 Adobe Systems Incorporated. All rights reserved.
Mon Jun 16 2008, 11:54 AM -07:00 Current page: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/motion/Animator.html
Comments
Markavian said on Mar 20, 2008 at 1:57 AM : Robert Penner said on Mar 20, 2008 at 3:16 PM :