PackagedragonBones.objects
Classpublic class SkeletonData
InheritanceSkeletonData Inheritance Object

A SkeletonData instance holds all data related to an Armature instance.

View the examples

See also

dragonBones.Bone
dragonBones.animation.Animation


Public Properties
 PropertyDefined By
  animationNames : Vector.<String>
[read-only] All Animation instance names belonging to this Skeletondata instance.
SkeletonData
  armatureNames : Vector.<String>
[read-only] All Armature instance names belonging to this Skeletondata instance.
SkeletonData
  frameRate : uint
[read-only] The frameRate of this Skeltondata instance.
SkeletonData
  name : String
[read-only] the name of this Skeletondata instance.
SkeletonData
Public Methods
 MethodDefined By
  
Creates a new SkeletonData instance.
SkeletonData
  
dispose():void
Clean up all resources used by this SkeletonData instance.
SkeletonData
  
getAnimationData(name:String):AnimationData
Get the AnimationData instance with this name.
SkeletonData
  
getArmatureData(name:String):ArmatureData
Get the ArmatureData instance with this name.
SkeletonData
  
getDisplayData(name:String):DisplayData
Get the DisplayData instance with this name.
SkeletonData
Property Detail
_animationDataListproperty
dragonBones_internal var _animationDataList:DataList

_armatureDataListproperty 
dragonBones_internal var _armatureDataList:DataList

_displayDataListproperty 
dragonBones_internal var _displayDataList:DataList

_frameRateproperty 
dragonBones_internal var _frameRate:uint

_nameproperty 
dragonBones_internal var _name:String

animationNamesproperty 
animationNames:Vector.<String>  [read-only]

All Animation instance names belonging to this Skeletondata instance.


Implementation
    public function get animationNames():Vector.<String>
armatureNamesproperty 
armatureNames:Vector.<String>  [read-only]

All Armature instance names belonging to this Skeletondata instance.


Implementation
    public function get armatureNames():Vector.<String>
frameRateproperty 
frameRate:uint  [read-only]

The frameRate of this Skeltondata instance.


Implementation
    public function get frameRate():uint
nameproperty 
name:String  [read-only]

the name of this Skeletondata instance.


Implementation
    public function get name():String
Constructor Detail
SkeletonData()Constructor
public function SkeletonData()

Creates a new SkeletonData instance.

Method Detail
dispose()method
public function dispose():void

Clean up all resources used by this SkeletonData instance.

getAnimationData()method 
public function getAnimationData(name:String):AnimationData

Get the AnimationData instance with this name.

Parameters

name:String — The name of the AnimationData instance to retreive.

Returns
AnimationData — AnimationData The AnimationData instance by that name.
getArmatureData()method 
public function getArmatureData(name:String):ArmatureData

Get the ArmatureData instance with this name.

Parameters

name:String — The name of the ArmatureData instance to retreive.

Returns
ArmatureData — ArmatureData The ArmatureData instance by that name.
getDisplayData()method 
public function getDisplayData(name:String):DisplayData

Get the DisplayData instance with this name.

Parameters

name:String — The name of the DisplayData instance to retreive.

Returns
DisplayData — AnimationData The DisplayData instance by that name.
Examples

Download the example files here:

This example parse the 'Dragon1.swf' data and stores its SkeletonData into the local variable named skeleton.

    
     package  
     {
         import dragonBones.Armature;
         import dragonBones.factorys.BaseFactory;
          import flash.display.Sprite;
         import flash.events.Event;    
             import dragonBones.objects.SkeletonData;
     
         public class DragonAnimation extends Sprite 
         {        
             [Embed(source = "Dragon1.swf", mimeType = "application/octet-stream")]  
             private static const ResourcesData:Class;
             
             private var factory:BaseFactory;
             private var armature:Armature;        
             
             public function DragonAnimation() 
             {                
                 factory = new BaseFactory();
                 factory.addEventListener(Event.COMPLETE, handleParseData);
                 var skeleton:SkeletonData = factory.parseData(new ResourcesData(), 'Dragon');
             }        
         }
     }