I\'m trying to remove an event listener inside of a listener definition:
canvas.addEventListener(\'click\', function(event) {
click++;
if(click == 50
I think you may need to define the handler function ahead of time, like so:
var myHandler = function(event) {
click++;
if(click == 50) {
this.removeEventListener('click', myHandler);
}
}
canvas.addEventListener('click', myHandler);
This will allow you to remove the handler by name from within itself.