The code posted above is from page 10 of the "HTML Developer’s Guide for ADOBE AIR (prerelease updated 11/16/2009)".

I am actually exiting the program because I only have one window open and I click on the red x in the top right corner to shut it down... in theory, the example above provided by Adobe, should interrupt the exit sequence by displaying an alert box amd then shut the program down.

Here's the excerpt from the manual...

unload events (for body and frameset objects)Adobe AIR 1.0 and later

In the top-level frameset or body tag of a window (including the main window of the application), do not use the unload event to respond to the window (or application) being closed. Instead, use exiting event of the NativeApplication object (to detect when an application is closing). Or use the closing event of the NativeWindow object (to detect when a window is closing). For example, the following JavaScript code displays a message ("Goodbye.") when the user closes the application:

However, scripts can successfully respond to the unload event caused by navigation of a frame, iframe, or top-level window content.Note: These limitations may be removed in a future version of Adobe AIR.