This content has been marked as final. Show 3 replies
Your general outline seems sound. Replace CUSTOM_EVENT_HERE with a string that gives your event some arbitrary name.
Also, "air.NativeApplication.activeWindow.dispatchEvent(myEvent);" should just be: window.nativeWindow.dispatchEvent(myEvent);
This still doesn't work. I get the error "TypeError: Undefined value" for the line
"var myEvent = new air.Event('loaded', true, false);".
But, it also gives this error when I try to dispatch
which should be pretty standard, right?
Does anyone have any idea what's setting off these errors?
After a lot of searching in the docs and this forum I found an easier way. To communicate from the new window to its parent (and to call any function) you can use window.parent.YOUR_FUNCTION();.
Hopefully this will save someone else some time because i've been searching for hours and still had to find it myself...