This was the standard boiler plate I was using:
var stage = new createjs.Stage("canvas1");
createjs.Ticker.addEventListener("tick",stage);
stage.enableMouseOver();
...
createjs.Ticker.setFPS(12);
createjs.Ticker.addListener(stage,false);
Apparently createjs.Ticker.addListener is no longer supported. How should the above code be changed?
Your example shows both the correct and deprecated usage.
// OLD
createjs.Ticker.addListener(stage,false);
// NEW
createjs.Ticker.addEventListener("tick", stage);
//OR
createjs.Ticker.on("tick", stage);
The changes make Ticker use the same Event dispatcher pattern that the rest of CreateJS does.
Additionally, the framerate method has changed to a setter:
// OLD
createjs.Ticker.setFPS(12);
// NEW
createjs.Ticker.framerate = 12;
It will depend on what version you use of EaselJS. I updated the demo you posted to the latest version using those changes: http://jsfiddle.net/lannymcnie/Aprdf/80/
Unfortunately there are still demos out there with out-of-date code. Let me know if you have any other questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With