Skip to content

Commit

Permalink
update delayParseAnimation demo
Browse files Browse the repository at this point in the history
  • Loading branch information
superlancelot committed Jul 7, 2014
1 parent 8b72d19 commit eb04cd2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ASLibraryDemos/src/Example_Knight_DelayParseAnimation.as
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,13 @@ class StarlingGame extends Sprite
private var _textField: TextField;

private var _animationDictionary:Dictionary = new Dictionary();
private var _fateRate:uint;
public function StarlingGame()
{
_factory = new StarlingFactory();

var rawData:Object = JSON.parse(new SkeletonJSONData());

var skeletonData: SkeletonData = DataParser.parseData(rawData, true);
DataParser.parseAnimationRawDataDictionary(rawData, _animationDictionary);
_fateRate = DataParser.parseFrameRate(rawData);
var skeletonData: SkeletonData = DataParser.parseData(rawData, true, _animationDictionary);

_factory.addSkeletonData(skeletonData, "knightSkeleton");

Expand Down Expand Up @@ -512,10 +509,10 @@ class StarlingGame extends Sprite

private function playAnimation(armature:Armature, animationName:String):void
{
if(_animationDictionary[animationName] != null)
if(_animationDictionary[armature.armatureData.name][animationName] != null)
{
_factory.addAnimationToArmature(_animationDictionary[animationName], armature, _fateRate);
_animationDictionary[animationName] = null;
_factory.addAnimationToArmature(_animationDictionary[armature.armatureData.name][animationName], armature);
_animationDictionary[armature.armatureData.name][animationName] = null;
}

armature.animation.gotoAndPlay(animationName);
Expand Down

0 comments on commit eb04cd2

Please sign in to comment.