Closed KokoDoko closed 10 years ago
The problem is that Tween adds a single listener to the Ticker when it is initialized, which is wiped out when you removeAllEventListeners.
As a workaround, you can add a listener back in using:
createjs.Ticker.addEventListener("tick", createjs.Tween);
Note that you should ensure you don't do this multiple times, as it could stack up multiple callbacks. http://jsfiddle.net/lannymcnie/BUyyv/4/
Thanks for checking it out!
I am adding and removing a html canvas element in an ajax application. When a new canvas is removed and added, I set the CreateJS stage to the new canvas.
So far it works, but my Tween is not firing any more. When adding an onchange handler to the tween, that doesn't fire either.
I can't figure out if the tween is broken, or is the tween still rendering to the old canvas? I have created a fiddle here:
http://jsfiddle.net/BUyyv/2/