canvas - Stop and Restart CreateJs animation -


i wondering how stop entire createjs canvas animation , how restart later. i'd save computing power , memory while canvas not visible user.

does know how?

thank in advance

simply remove listener on ticker. example:

createjs.ticker.removeeventlistener("tick", mystageortickfunction); // add later unpause: createjs.ticker.addeventlistener("tick", mystageortickfunction); 

if want reset entire animation exported flash, have couple of options:

  1. you can re-instantiate main timeline. you'll need take @ output code grab name of main timeline symbol, based on fla name (ex. fla named "test.fla" have main timeline symbol named "test").

stage.removechildat(0);

stage.addchild(new lib.test());

  1. you can use gotoandplay(0). requires child movieclips set graphic instances though, because mcs play independently of parent.

stage.getchildat(0).gotoandplay(0)


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -