2013-03-06 43 views
0

不删除阶段的孩子,我创建了一个拥有圆和text.i我都动画使用对象在createjs

  var tween = createjs.Tween.get(ball, {loop:true}) 
       .to({x:ball.x, y:canvas.height - 55, rotation:-360}, 1500, createjs.Ease.bounceOut) 
       .wait(1000) 
       .to({x:canvas.width-55, rotation:360}, 2500, createjs.Ease.bounceOut) 
       .wait(1000).call(stop); 

     function stop(){ 
     stage.removeChild(txt); 
     stage.removeChild(ball); 
     createjs.Ticker.removeEventListener("tick", tick); 
     createjs.Ticker.removeEventListener("tick", stage); 

     } 

但在停止方法的removeChild之不调用一个阶段。任何人都可以告诉我我错在哪里。

回答

0

您可以通过将范围传递给“调用”函数来解决此问题。目前它正在对球实例调用停止。

.wait(1000).call(stop, null, this);