flash builder - Flex AS3 asynchronous sprite (MovieClip) animation -
i'm using starling framework under flex as3 project. i've sprite named bird , use altas animation.
my problem is, there 2 bird in screen , both of them flaps @ same time. want flap asynchronous.
how can this, can give start frame number each of them ? thanks..
public class bird extends sprite { private var bird_mc:movieclip; public function bird(startframe:number = 0) { super(); this.addeventlistener(starling.events.event.added_to_stage, onaddedtostage); } private function onaddedtostage(event:event):void { this.removeeventlistener(event.added_to_stage, onaddedtostage); createbird_mc(); } private function createbird_mc():void { bird_mc = new movieclip(assets.getatlas().gettextures("bird_"), 16); bird_mc.x = math.ceil(-bird_mc.width/2); bird_mc.y = math.ceil(-bird_mc.height/2); starling.core.starling.juggler.add(bird_mc); this.addchild(bird_mc); } }
the solution setting activeframe before add stage.
Comments
Post a Comment