I am trying to figure out how to add an event listener in javascript for the exiting event when the red x is clicked on a Windows window (top right corner).
I found this among adobe documentation, but it does not work:
var app = air.NativeApplication.nativeApplication;
app.addEventListener(air.Event.EXITING, closeHandler);
function closeHandler(event) {
alert("Goodbye.");
}
And yes I have the AIRAliases.js included.
Thanks