2013-03-06 30 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);