Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Event listeners generate errors while modal windows are shown.

$
0
0

Hello all,

 

I have an interface in script ui that relies on event listeners initialized like this:

var button = palette.add("image", rect);
button.onDraw = buttonDraw;
button.addEventListener('mouseover', onMouse, false);
button.addEventListener('mouseout', onMouse, false);
button.addEventListener('mousedown', onMouse, false);
button.addEventListener('mouseup', onMouse, false);

 

I need these events so I can change images (fake buttons) when the user moves the mouse over them or clicks one of them. Everything works as it should, until I decided to render something. While rendering in After Effects, a window or something is opened somewhere and it makes all scripts useless, they do not respond to user input at all, and that's fine to me. It works the same for all scripts that I tested.

The real problem is with event listeners. Scripts that use them will generate a background error if any listener is activated. And when the render finishes, AE will show a popup message letting you know about these errors. Also the script interface will stop running completely until you close it an open it again.

 

The error message is:

"Can not run a script while a modal dialog is waiting for response."

 

I thought of replacing all listeners with the other type of callback like "onClick", but it seems there's no workaround for "mouseover" or "mouseout".

 

This is a real issue for my UI, as if the user has my panel docked somewhere in the interface and simply moves the mouse over any of the buttons, he will end up with the error message at the end of the render. There's also nothing I can do to avoid the listeners from running, since after the script is loaded, we lose all control of what's going on with it, no way to remove the listeners temporarily.

 

Any ideas on how to solve this?


Viewing all articles
Browse latest Browse all 2143

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>