| 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 |
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.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
| 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 | ||
| 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 the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
| 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.
public function get name():String
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.
public function get rootJoint():IKJointSee also
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;
| 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.
|
See also
import fl.ik.*;
// Retrieve bone named "firstBone" and store in variable "bone"
var bone:IKBone = IKArmature.getBoneByName("firstBone");
| registerElements | () | method |
public function registerElements(stage: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
stage:DisplayObjectContainer — A reference to the stage, accessible through the stage
property of any DisplayObject that is currently on the display list.
|
* |
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);