- Creator 版本号:1.5.2
- 目标平台:(Web )
- 详细报错信息,包含调用堆栈:
TypeError: Cannot read property ‘isDone’ of null
at TheClass.update (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:4278:60)
at TheClass.update (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:11630:95)
at TheClass.mainLoop (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:9271:45)
at callback (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:10171:34)
测试代码
let endOne = function(){
this.hellWord.setPosition(cc.p(0,0))
this.hellWord.removeFromParent();
}
let seq = cc.sequence(
cc.moveBy(2,cc.p(0,-10)).easing(cc.easeCubicActionIn()),
cc.moveBy(3,cc.p(100,200)),
cc.callFunc(endOne .bind(this))
);
this.hellWord.runAction(seq)
let sefl = this;//add
let endOne = function(){
self.hellWord.setPosition(cc.p(0,0)) //modify
self.hellWord.removeFromParent();//modify
}
let seq = cc.sequence(
cc.moveBy(2,cc.p(0,-10)).easing(cc.easeCubicActionIn()),
cc.moveBy(3,cc.p(100,200)),
cc.callFunc(endOne)
);
this.hellWord.runAction(seq)
改成上面的试试
一样的。不是写法的问题。是底层update定时器没有及时关闭。
问题修复在:
https://github.com/cocos-creator/engine/pull/1806/files
1.5.2 上可以自己修复一下,然后在 engine 目录下执行 gulp build
刚升级到1.5.2就遇到这个问题。很奇怪。这个是基本的东西,怎么没有测试就放出来了吗。
嗯,很抱歉,现在已经优化了测试例,这个部分已经覆盖到了