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:
- 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());
- you can use
gotoandplay(0)
. requires child movieclips set graphic instances though, because mcs play independently of parent.
stage.getchildat(0).gotoandplay(0)
Comments
Post a Comment