cc.Animation结束动画后,怎么将动画设置为第一帧状态?

cc.Animation结束动画后,怎么将动画设置为第一帧状态?用setCurrentTime(0)在ios试过了无效
1.4.2版本的creator
@jjyinkailejj大神 这个功能需求很常用,帮忙看看回复下,谢啦!

现在版本的 setCurrentTime 内部会调用 sample, 1.4.2 忘了有没有调用了
你再手动调用一下 sample 看看

sample?我也遇到这个问题了,大神。调用ani.setCurrentTime(0);无效

animation.play(‘clipname’);
animation.setCurrentTime(0,‘clipname’);
animation.sample(‘clipname’);

2赞

Uncaught TypeError: cc.AnimationState is not a constructor
at CCClass._createStates (CCAnimation.js:616)
at CCClass._init (CCAnimation.js:604)
at CCClass.playAdditive (CCAnimation.js:241)
at CCClass.play (CCAnimation.js:220)
at CCClass.playEfx (MJGame.js:446)
at CCClass. (MJGame.js:296)
at EventListeners.98.EventListeners.invoke (event-listeners.js:66)
at CCClass.99.proto.emit (event-target.js:355)
at CCClass.dispatchEvent (GameNetMgr.js:79)
at CCClass.doPeng (GameNetMgr.js:667)
这是怎么回事

this.anim.setCurrentTime(0,‘up’);
this.anim.stop();
用setCurrentTime把当前动画时间设成0,接着停止动画就可以了,单纯用setCurrentTime一点毛效果都没有。
如果大家有更好的方法请务必告诉我!

1赞