I'm having a weird issue where Event Listeners are crashing my script whenever After Effects is rendering
The script example below updates a staticText to indicate the cursor event Type. While rendering, if the cursor enters the window the script will crash and the text will no longer update. If you rerun the script you will see the error "Can not run a script while a modal dialog is waiting for response".
Any ideas?
function myScript(thisObj){ function myScript_buildUI(thisObj){ // var w = (thisObj instanceof Panel) ? thisObj : new Window("palette", "test", undefined, {resizeable: true}); var paletteText = w.add("staticText"); paletteText.alignment = ["fill", "top"]; paletteText.text = "Mouse Out"; w.addEventListener("mouseout", cursorHandler); w.addEventListener("mouseover", cursorHandler); // // function cursorHandler (ev){ if(ev.type == "mouseout" && ev.target.constructor.name == "Panel"){ paletteText.text = "Mouse Out"; } if(ev.type == "mouseover" && ev.target.constructor.name == "Panel"){ paletteText.text = "Mouse Over"; } } // w.onResize = function(){ this.layout.resize (); } // w.layout.layout(true); return w; // } var myScriptPal = myScript_buildUI(thisObj); if((myScriptPal != null) && (myScriptPal instanceof Window)){ myScriptPal.center(); myScriptPal.show(); } } // myScript(this);