| Package | fl.motion | 
| Class | public class Animator | 
| Inheritance | Animator    AnimatorBase   EventDispatcher   Object | 
| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS3 | 
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 | 
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.
Note: In Flash CS3, some properties and methods supported by this class were members of this class, exclusively. Flash CS4 introduced a base class, AnimatorBase, for those properties and methods of this class, and they are now shared by other classes through the inheritance chain. If you have been working in Flash CS3, notice that these properties and methods are still supported by the Animator class, but are members of the AnimatorBase class in releases of Flash Professional after Flash CS3. As with any other class in this reference, select Show Inherited Public Properties and Show Inherited Public Methods to see all of the properties and methods supported by this class.
Default MXML Propertymotion
Related API Elements
| Property | Defined By | ||
|---|---|---|---|
![]()  | autoRewind : Boolean = false 
     Sets the animation to restart after it finishes.  | AnimatorBase | |
![]()  | constructor : Object 
	 A reference to the class object or constructor function for a given object instance.  | Object | |
![]()  | frameEvent : String 
     The name of the event object created by the Event.ENTER_FRAME event.  | AnimatorBase | |
![]()  | initialPosition : Array [write-only] 
     An array of coordinates defining the starting location of the animation.  | AnimatorBase | |
![]()  | instanceFactoryClass : Class 
     When creating instances with ActionScript, this is the class that creates the instance.  | AnimatorBase | |
![]()  | isPlaying : Boolean [read-only] 
     Indicates whether the animation is currently playing.  | AnimatorBase | |
![]()  | motion : MotionBase 
     The object that contains the motion tween properties for the
     animation.  | AnimatorBase | |
![]()  | motionArray : Array 
     The Array of objects that contains the motion tween properties
     for the animation.  | AnimatorBase | |
![]()  | orientToPath : Boolean = false 
     Sets the position of the display object along the motion path.  | AnimatorBase | |
![]()  | placeholderName : String 
     When creating instances with ActionScript, this is the instance that appears on stage that we will replace.  | AnimatorBase | |
![]()  | positionMatrix : Matrix 
     The Matrix object that applies an overall transformation to the motion path.  | AnimatorBase | |
![]()  | repeatCount : int = 1 
      Number of times to repeat the animation.  | AnimatorBase | |
![]()  | sceneName : String 
   		A reference for exported scenes, for 3D motion, so the scene can be loaded into a parent timeline.  | AnimatorBase | |
![]()  | spanEnd : int [read-only] 
	Returns the frame of the target's parent on which the animation of the target ends.  | AnimatorBase | |
![]()  | spanStart : int [read-only] 
	Returns the frame of the target's parent on which the animation of the target begins.  | AnimatorBase | |
![]()  | target : DisplayObject 
     The display object being animated.  | AnimatorBase | |
![]()  | targetName : String 
     The name of the target object as seen by the parent DisplayObjectContainer.  | AnimatorBase | |
![]()  | targetParent : DisplayObjectContainer 
     The target parent DisplayObjectContainer being animated, which can be used in conjunction with targetName
     to retrieve the target object after it is removed and then replaced on the timeline.  | AnimatorBase | |
![]()  | targetParentButton : SimpleButton | AnimatorBase | |
![]()  | targetState3D : Array 
     The initial orientation for the target object.  | AnimatorBase | |
![]()  | time : int 
     A zero-based integer that indicates and controls the time in
     the current animation.  | AnimatorBase | |
![]()  | transformationPoint : Point 
     The point of reference for rotating or scaling a display object.  | AnimatorBase | |
![]()  | transformationPointZ : int 
	 The z-coordinate point of reference for rotating or scaling a display object.  | AnimatorBase | |
![]()  | usingCurrentFrame : Boolean [read-only] 
	Indicates whether the currentFrame property is checked whenever a new frame is entered and
	whether the target's animation is synchronized to the frames in its parent's timeline, 
	or always advancing no matter what the parent's current frame is.  | AnimatorBase | |
| Method | Defined By | ||
|---|---|---|---|
     Creates an Animator object to apply the XML-based motion tween description to a display object.  | Animator | ||
![]()  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void 
	Registers an event listener object with an EventDispatcher object so that the listener 
	receives notification of an event.  | EventDispatcher | |
![]()  | 
	Dispatches an event into the event flow.  | EventDispatcher | |
![]()  | 
      Stops the animation and Flash Player goes immediately to the last frame in the animation sequence.  | AnimatorBase | |
[static] 
     Creates an Animator object from a string of XML.  | Animator | ||
![]()  | 
	Checks whether the EventDispatcher object has any listeners registered for a specific type 
	of event.  | EventDispatcher | |
![]()  | 
	 Indicates whether an object has a specified property defined.  | Object | |
![]()  | 
	 Indicates whether an instance of the Object class is in the prototype chain of the object specified 
	 as the parameter.  | Object | |
[static] 
     Compares two matrices specified as parameters and returns true if they are equal to one another.  | Animator | ||
![]()  | 
     Advances Flash Player to the next frame in the animation sequence.  | AnimatorBase | |
![]()  | 
      Pauses the animation until you call the resume() method.  | AnimatorBase | |
![]()  | 
      Begins the animation.  | AnimatorBase | |
![]()  | processCurrentFrame(parent:MovieClip, anim:AnimatorBase, startEnterFrame:Boolean, playOnly:Boolean = false):void [static]   | AnimatorBase | |
![]()  | 
	 Indicates whether the specified property exists and is enumerable.  | Object | |
![]()  | registerParentFrameHandler(parent:MovieClip, anim:AnimatorBase, spanStart:int, repeatCount:int = 0, useCurrentFrame:Boolean = false):void [static] 
	Registers the given MovieClip and an AnimatorBase instance for a child of that MovieClip.  | AnimatorBase | |
![]()  | 
	Removes a listener from the EventDispatcher object.  | EventDispatcher | |
![]()  | 
      Resumes the animation after it has been paused 
      by the pause() method.  | AnimatorBase | |
![]()  | 
     Sets Flash Player to the first frame of the animation.  | AnimatorBase | |
![]()  | 
     Sets the availability of a dynamic property for loop operations.  | Object | |
![]()  | 
      Initiates frame events.  | AnimatorBase | |
![]()  | 
      Stops the animation and Flash Player goes back to the first frame in the animation sequence.  | AnimatorBase | |
![]()  | 
	 Returns the string representation of this object, formatted according to locale-specific conventions.  | Object | |
![]()  | 
	 Returns the string representation of the specified object.  | Object | |
![]()  | 
     Sets the currentFrame property whenever a new frame is entered, and
     sets whether the target's animation is synchronized to the frames in its parent MovieClips's timeline.  | AnimatorBase | |
![]()  | 
	 Returns the primitive value of the specified object.  | Object | |
![]()  | 
	Checks whether an event listener is registered with this EventDispatcher object or any of 
	its ancestors for the specified event type.  | EventDispatcher | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
![]()  | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | ||
![]()  | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | ||
![]()  | Dispatched when the motion finishes playing, either when it reaches the end, or when the motion is interrupted by a call to the stop() or end() methods. | AnimatorBase | ||
![]()  | Dispatched when the motion starts playing. | AnimatorBase | ||
![]()  | Dispatched when the motion has changed and the screen has been updated. | AnimatorBase | ||
![]()  | Dispatched when the Animator's time value has changed, but the screen has not yet been updated (i.e., the motionUpdate event). | AnimatorBase | ||
Animator | () | Constructor | 
public function Animator(xml:XML = null, target:DisplayObject = null)| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS3 | 
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 | 
Creates an Animator object to apply the XML-based motion tween description to a display object.
Parametersxml:XML (default = null) — An E4X object containing an XML-based motion tween description.
     
      | |
target:DisplayObject (default = null) — The display object using the motion tween.
      | 
Related API Elements
fromXMLString | () | method | 
 public static function fromXMLString(xmlString:String, target:DisplayObject = null):Animator| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS3 | 
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.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.
     
      | 
Animator — An Animator instance that applies the specified xmlString to the specified target.
      | 
Related API Elements
matricesEqual | () | method | 
 public static function matricesEqual(a:Matrix, b:Matrix):Boolean| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS5 | 
| Runtime Versions: | Flash Player 10.1, AIR 2 | 
     Compares two matrices specified as parameters and returns true if they are equal to one another.
     
Parameters
a:Matrix — The first Matrix object instance for comparison.
      | |
b:Matrix — The second Matrix object instance for comparison.
      | 
Boolean — A Boolean value; true if the two matrices are equal to one another, otherwise false.
      | 
Thu Dec 4 2014, 05:50 PM -08:00
 