Package | fl.ik |
Class | public class IKArmature |
Inheritance | IKArmature Object |
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
springsEnabled
property.
Because armatures can be created only in the Flash authoring
tool, you should not use the IKArmature class's constructor to create
instances of this class. Flash Player creates all instances
of the IKArmature class when a SWF file starts running. You can create a
reference to an armature by using the getArmatureAt()
or the getArmatureByName()
methods
in the IKManager class.
Note: If an armature is not in the first frame of a scene,
use the registerElements()
method to initialize
the armature for a specific DisplayObject.
More examples
Related API Elements
Property | Defined By | ||
---|---|---|---|
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
container : DisplayObjectContainer [read-only]
Returns DisplayObjectContainer passed into call to registerElements. | IKArmature | ||
name : String [read-only]
The name of the armature. | IKArmature | ||
prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | ||
rootJoint : IKJoint [read-only]
The root joint in the armature. | IKArmature | ||
springsEnabled : Boolean
Specifies whether springs are enabled for an armature. | IKArmature |
Method | Defined By | ||
---|---|---|---|
Returns the specified bone. | IKArmature | ||
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 | ||
Activates inverse kinematic (IK) movement for a library symbol instance
that contains an armature. | IKArmature | ||
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 |
container | property |
container:DisplayObjectContainer
[read-only] Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns DisplayObjectContainer passed into call to registerElements.
Implementation
public function get container():DisplayObjectContainer
name | property |
name:String
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The name of the armature. The name of an armature can be specified only in the Flash authoring tool.
Implementation
public function get name():String
Example ( How to use this example )
import fl.ik.*; // Retrieve the first armature and store in variable "arm0" var arm0:IKArmature = IKManager.getArmatureAt(0); // Trace the name of the first armature trace(arm0.name);
rootJoint | property |
rootJoint:IKJoint
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The root joint in the armature. Each armature contains exactly one root joint, but can have multiple child joints. You can traverse an armature by retrieving the root joint and using methods in the IKJoint class to move from joint to joint.
Implementation
public function get rootJoint():IKJoint
Related API Elements
Example ( How to use this example )
import fl.ik.*; // Retrieve the first armature and store in variable "arm0" var arm0:IKArmature = IKManager.getArmatureAt(0); // Retrieve the armature's root joint var rootJnt:IKJoint = arm0.rootJoint;
springsEnabled | property |
springsEnabled:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10.1, AIR 1.5 |
Specifies whether springs are enabled for an armature. When this value is true, the armature can take advantage of the new dynamic physics engine, which adds spring and damping to animation. The default value is true.
myArmature:IKArmature = fl.ik.IKManager.getArmatureAt(0); myArmature.springsEnabled = true; // turns springs on
Implementation
public function get springsEnabled():Boolean
public function set springsEnabled(value:Boolean):void
getBoneByName | () | method |
public function getBoneByName(targetName:String):IKBone
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the specified bone. Each bone can be assigned a name in the Flash authoring tool. Use this method to create a reference to a bone so you can manipulate the bone at run time.
Parameters
targetName:String |
IKBone — An IKBone instance specified by the targetName parameter.
|
Related API Elements
Example ( How to use this example )
import fl.ik.*; // Retrieve bone named "firstBone" and store in variable "bone" var bone:IKBone = IKArmature.getBoneByName("firstBone");
registerElements | () | method |
public function registerElements(container:DisplayObjectContainer):*
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Activates inverse kinematic (IK) movement for a library symbol instance that contains an armature. A library MovieClip that contains an armature and is instantiated at run time must call this method in order to activate run time inverse kinematic effects.
Note: This method must be called if the armature is not in the first frame of the first scene.
Parameters
container:DisplayObjectContainer — A reference to the stage, accessible through the stage
property of any DisplayObject that is currently on the display list.
|
* |
Example ( How to use this example )
import fl.ik.*; // Add a Library Symbol named "IKPerson" // that contains an armature. // The symbol must be marked "Export for ActionScript" var myPerson:IKPerson = new IKPerson(); // add MovieClip to display list addChild(myPerson); // The IKPerson MovieClip contains an IK Armature with the name // "Armature_Person" and marked as Runtime Armature instead of Authortime Armature var myArmature:IKArmature = IKManager.getArmatureByName("Armature_Person"); // Allow armature to perform inverse kinematic // movement at run time myArmature.registerElements(stage); // Allow user to track armature and perform // IK movement with the mouse IKManager.trackIKArmature(myArmature, true);
The following example shows how to use the registerElements()
method to
initialize an armature that is not in the first frame of a scene. To initialize
an armature, attach the following code to the first frame containing the armature:
import fl.ik.*; var arm:IKArmature = IKManager.getArmatureAt(0); arm.registerElements(stage);
Mon Nov 28 2011, 06:48 AM -08:00