0

i created a stage which holds one circle and a text.i am animating both using

           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);

       }

but the removechild in stop method is not calling . could any one tell me where i've mistaken.

Gajini
  • 413
  • 1
  • 5
  • 21

1 Answers1

0

You can fix this by passing a scope to your "call" function. Currently it is calling stop on the ball instance.

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

Lanny
  • 11,244
  • 1
  • 22
  • 30