Copy link to clipboard
Copied
I keep seeing the Ticker being used to execute functions. I just wanted to clarify a few things.
It seems to be used when something is loading ie: check to see if the object is loaded then execute the function.
What's the difference between
this.on("click", clickHandler, here, false);
AND
createjs.Ticker.on("tick", ckickHandler);
Also, in the old days, you had to use am add event listener to check if the stage was added, then execute the code. I think it was also a bad idea to put code on the first frame.
Do we need to add anything to our HTML5 canvas first frame?
thie "click" event occurs once each time the user clicks (mousedown and mouseup) something.
the Ticker "tick" event executes repeatedly at the framerate of the project. so, it's ideal to use for checking to see if something has occured yet, and if not, check again a fraction of a second later.
typically, when that something has occured something is done AND the Ticker "tick" loop is terminated (with removeEventListener or the off method).
generally, nothing needs to be added to a html5 fi
...Copy link to clipboard
Copied
thie "click" event occurs once each time the user clicks (mousedown and mouseup) something.
the Ticker "tick" event executes repeatedly at the framerate of the project. so, it's ideal to use for checking to see if something has occured yet, and if not, check again a fraction of a second later.
typically, when that something has occured something is done AND the Ticker "tick" loop is terminated (with removeEventListener or the off method).
generally, nothing needs to be added to a html5 first frame but it would be unusual to put nothing in the first frame.