event.target in JS/HTML5 Canvas [Event Bubbling]
Hello,
in AS3 i used to do this for event bubbling (using evt.target or evt.currentTarget).
mc1.addEventListener(MouseEvent.CLICK, myFunction);
function myFunction(evt:MouseEvent) {
evt.currentTarget.x=300;}
So i write the function only once and added the listener to multiple Targets(symbol instances).
mc2.addEventListener(MouseEvent.CLICK, myFunction);
mc3.addEventListener(MouseEvent.CLICK, myFunction);
How i have to re-write this in JS/HTML5 Canvas? I tried
this.mc1.addEventListener("click", myFunction.bind(this));
function myFunction(evt)
{this.evt.target.x=300;}
But it does not work.
