我在试着阻止一名混血儿继续。时钟已从屏幕上移除,但功能仍在启动。
我试着在下面做这件事,但是当我的“计时器长度”上升后,我仍然能听到声音。
clockContainer.removeAllChildren();
self.stage.removeChild(mytweentodisable);不确定如何重构它以阻止函数继续运行。
mytweentodisable = createjs.Tween.get(clockHand, { loop: false }).to({ rotation: 360 }, TimerLength).call(function () {
//this will trigger the timer is up
if (gameIsRunning == true) {
createjs.Sound.stop();
gameIsRunning = false;
createjs.Sound.play("gameOver");
}
});发布于 2016-04-26 13:39:54
希望我理解你的目标:]
从对象中删除tweens非常简单,并通过调用:
Tween.removeTweens(target)
如TweenJS文档中所述:
removeTweens (目标) 在removeTweens中定义:444删除目标的所有现有吐温。如果重写属性为true,则由新的tweens自动调用。参数:目标对象 要从其中删除现有吐温的目标对象。
参考资料:removeTweens
您可以在这里看到一个非常简单的示例Iv'e安装:http://jsfiddle.net/2ot8pr0h/2/
(单击按钮将删除所有球的吐温)。
https://stackoverflow.com/questions/36866336
复制相似问题