Search code examples
easeljscreatejs

On Progress Event of SpriteSheet Animation Using createjs?


I am using "onAnimationEnd" event but want to do some work when animation is progress. So I want to know current animated frame number via any progress or any event ?

Thanks for your help.


Solution

  • You can use the tick-event (http://www.createjs.com/Docs/EaselJS/classes/BitmapAnimation.html#event_tick) and the use the properties currentAnimation, currentAnimationFrame and/or currentFrame (http://www.createjs.com/Docs/EaselJS/classes/BitmapAnimation.html#property_currentAnimation)

    Update: Sprite now dispatches a change event whenever the displayed frame changes. (by gskinner via comments)