From eb04cd254863d6434a3b134dfcf294e2647d6c40 Mon Sep 17 00:00:00 2001 From: Chenguang Liu Date: Mon, 7 Jul 2014 17:04:51 +0800 Subject: [PATCH] update delayParseAnimation demo --- .../src/Example_Knight_DelayParseAnimation.as | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ASLibraryDemos/src/Example_Knight_DelayParseAnimation.as b/ASLibraryDemos/src/Example_Knight_DelayParseAnimation.as index 6626613..3ecdc28 100644 --- a/ASLibraryDemos/src/Example_Knight_DelayParseAnimation.as +++ b/ASLibraryDemos/src/Example_Knight_DelayParseAnimation.as @@ -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"); @@ -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);