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

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -