| Package | fl.motion | 
| Class | public class AnimatorFactory | 
| Inheritance | AnimatorFactory    AnimatorFactoryBase   Object | 
| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS3 | 
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 | 
Use the AnimatorFactory constructor to create an AnimatorFactory instance. Then, use the methods inherited from the AnimatorFactoryBase class to associate the desired properties with display objects.
More examples
Related API Elements
Public Properties
| Property | Defined By | ||
|---|---|---|---|
![]()  | constructor : Object 
	 A reference to the class object or constructor function for a given object instance.  | Object | |
![]()  | motion : MotionBase [read-only] 
	The MotionBase instance that the AnimatorFactoryBase instance and its target objects are associated with.  | AnimatorFactoryBase | |
![]()  | sceneName : String [write-only] 
   		A reference for exported scenes, for 3D motion, so the scene can be loaded into a parent timeline.  | AnimatorFactoryBase | |
![]()  | transformationPoint : Point [write-only] 
	 The point of reference for rotating or scaling a display object.  | AnimatorFactoryBase | |
![]()  | transformationPointZ : int [write-only] 
	 The z-coordinate point of reference for rotating or scaling a display object.  | AnimatorFactoryBase | |
Public Methods 
| Method | Defined By | ||
|---|---|---|---|
     Creates an AnimatorFactory instance you can use to assign the properties of
     a MotionBase object to display objects.  | AnimatorFactory | ||
![]()  | addTarget(target:DisplayObject, repeatCount:int = 0, autoPlay:Boolean = true, startFrame:int = -1, useCurrentFrame:Boolean = false):AnimatorBase 
	Creates and returns an AnimatorBase instance whose target property is set to the DisplayObject (if applicable)
	that is the targetName property of the targetParent,
	and whose Motion property is stored in the AnimatorFactoryBase instance upon creation.  | AnimatorFactoryBase | |
![]()  | addTargetInfo(targetParent:DisplayObject, targetName:String, repeatCount:int = 0, autoPlay:Boolean = true, startFrame:int = -1, useCurrentFrame:Boolean = false, initialPosition:Array = null, zIndex:int = -1, placeholderName:String = null, instanceFactoryClass:Class = null):AnimatorBase 
	References the parent DisplayObjectContainer and then creates and returns an AnimatorBase 
	instance whose target property is set to the DisplayObject (if applicable) 
	that is the targetName property of the targetParent,
	and whose Motion property is stored in the AnimatorFactoryBase instance upon creation.  | AnimatorFactoryBase | |
![]()  | 
	 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 | |
![]()  | 
	 Indicates whether the specified property exists and is enumerable.  | Object | |
![]()  | 
     Sets the availability of a dynamic property for loop operations.  | Object | |
![]()  | 
	 Returns the string representation of this object, formatted according to locale-specific conventions.  | Object | |
![]()  | 
	 Returns the string representation of the specified object.  | Object | |
![]()  | 
	 Returns the primitive value of the specified object.  | Object | |
Constructor Detail
AnimatorFactory | () | Constructor | 
public function AnimatorFactory(motion:MotionBase, motionArray:Array = null)| Language Version: | ActionScript 3.0 | 
| Product Version: | Flash CS3 | 
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 | 
Creates an AnimatorFactory instance you can use to assign the properties of a MotionBase object to display objects.
Parametersmotion:MotionBase — The MotionBase object containing the desired motion properties.
     .
      | |
motionArray:Array (default = null) | 
Related API Elements
Examples How to use this example 
MotionBaseExample.as
 This example shows how to animate a sprite with
   the use of the MotionBase and AnimatorFactory classes. A MotionBase object is
   assigned arrays of x and y coordinates, and is then used to create an
   AnimatorFactory object. The AnimatorFactory is finally targeted to a sprite,
   in the form of a filled rectangle.
package 
{
     import flash.display.MovieClip;
     import flash.display.Sprite;
     import fl.motion.AnimatorFactory;
     import fl.motion.MotionBase;
     import flash.geom.Point;
    
     public class  MotionBaseExample extends MovieClip
     {
          private var motionBase:MotionBase;
          private var animFactory:AnimatorFactory;
          private var size:uint    = 100;
          private var bgColor:uint = 0xFFCC00;
          public function MotionBaseExample():void
          {
               var boxObj:sprite = new Sprite();
               boxObj.graphics.beginFill(bgColor);
               boxObj.graphics.drawRect(0, 0, size, size);
               boxObj.graphics.endFill();
               addChild(boxObj);
               motionBase = new MotionBase();
               motionBase.duration = 20;
               motionBase.addPropertyArray("x",[0,50,95,134,169,199,225,247,265,280]);
               motionBase.addPropertyArray("y",[0,1,0,4,12,21,32,44,52,38]);
               animFactory = new AnimatorFactory(motionBase);
               animFactory.transformationPoint = new Point(2, 2);
               animFactory.addTarget(boxObj, 0);
          }
     }    
}
Thu Dec 4 2014, 05:50 PM -08:00
 