"stagemouseup" already exists on the Stage object. If I add it like this would I get multiple callbacks?
stage.addEventListener("stagemouseup", function(){window.open(window.clickTag);});
In my local testing only 1 window launches so it seemed safe. However, after reading the docs it seems like this is the answer:
stage.on("stagemouseup", function(){window.open(window.clickTag);});
Can someone help me confirm?
If you add the listener multiple times, you will get multiple callbacks on each click.
The on()
method is a shortcut for addEventListener
that has some syntactic sugar, such as:
scope
parameter (and implicit scope if none is passed, instead of defaulting to window
)There is also some functionality on the events dispatched by on()
, which allow you to easily remove the handler.
http://createjs.com/docs/easeljs/classes/EventDispatcher.html#method_on