What could be the reason for CreateJS mouse clicks not working at all?
Editing to clarify:
What could be the potential reasons for Animate-CC/CreatJS Canvas mouse interactions to work here (press the video play button ) but not here (press the button "play")?
Some type of "blocking", preventing the Canvas for getting the click?
Clarifying more:
Please open the console, you will see the first site logging both the canvas and the stage clicks, while the second one logs only the canvas clicks.
This is the code I have:
this.stage.addEventListener("click", function(){console.log("stage is clicked")});
this.stage.canvas.addEventListener("click", function(){console.log("canvas is clicked")});
My code is loaded into both of the above pages, but the second page does something that makes the stage unclickable.
Any ideas?
Thanks in advance!
Update 1:
Please see that the working example above is having my creative (id "iRoll") wrapped inside an iFrame, while the not-working example is not. That probably affects the way DOM mouse interactions are interpreted by the CreateJS framework.
Also, I have added to the above examples this code:
that.mcBTN.addEventListener("rollover", function (e) {
that.mcBTN.gotoAndStop(1);
});
that.mcBTN.addEventListener("rollout", function (e) {
that.mcBTN.gotoAndStop(0);
});
that.mcBTN being the black box, and i have the text "(rolled on)" on frame 1.
This is the code that changes the colored box on clicks:
that.first = true;
that.mcBTN.addEventListener("click", function (e) {
that.mcChanger.gotoAndStop(that.first);
that.first = !that.first;
});
If you alternate-click inside the black box and outside of it, you can see that some things are registered correctly in terms of coordinates system - (the "rolled on" text appears as it should), but still the click function and rollover function themselves somehow do not work (i.e, the colored box doesn't change color and the "rolled on" text doesn't appear based on rollover interaction.