What Wick Editor Version are you using?
1.19.3
Describe the Problem
mouseX normally returns the x-coordinate of your mouse.
so I wrote a bit of code to catch the context menu popup event and read the mouseX, but mouseX is not defined inside of the event handler
What have you tried so far?
I have searched through the forms.
I have tried to store the “path” to mouseX in a variable so I can reference mouseX from within the event handler but I don’t know how to do that (window.mouseX works outside of the event handler code but not inside although the window object exist).
Do you have a Wick Editor File that we can see?
code snippet:
var thisClip=this;
alert(“mouseX:”+window.mouseX); //returns mouseX
debugClip.debugText.setText(“hello before”);
if (document.addEventListener) {
document.addEventListener(‘contextmenu’, function(e) { //or use (e) =>
e.preventDefault();
alert(“mouseX:”+window.mouseX); //fails, returns “undefined”
alert(“mouseX:”+mouseX); //throws Reference error exception