2012-05-16 41 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鏈接。 –