2012-05-16 102 views

回答

5

对于精灵表动画可以使用onAnimationEnd这样的:

// create a BitmapAnimation instance to display and play back the sprite sheet: 

var bmpAnim = new BitmapAnimation(spriteSheet); 

// start playing the first sequence: 

bmpAnim.gotoAndPlay("walkRt"); 

// the callback is called each time a sequence completes: 

bmpAnim.onAnimationEnd = angleChange; 

Online api doc here: 
http://www.createjs.com/Docs/EaselJS/BitmapAnimation.html 

如果使用补间从TweenJS可以使用呼叫功能上一个Tween实例:

实施例:

Tween.get(bar, {override:true}).to({x:695}, 1500, easeType).call(tweenComplete); 

在线API API文档: http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html

+0

在EaselJS 0.7.1,该事件被称为“animationEnd”,和“BitmapAnimation”类有利于“雪碧”的被弃用。文档:http://www.createjs.com/Docs/EaselJS/classes/Sprite.html –

+0

@ user1417233:联机API文档链接已损坏。 – moonman239

+0

http://www.createjs.com/docs/easeljs/classes/Sprite.html#method_stop更新了API链接。 –