This content has been marked as final.
Show 2 replies
-
1. Re: Manual for AIR
Dr. Fred Mbogo Apr 5, 2008 6:06 AM (in response to DanelKirch)The error says that the object 'stage' doesn't have a property 'window'. And if I open the Help in Flex Builder and do a search for 'stage', I come to the reference for 'flash.display.Stage', and indeed, there is no 'window' property. This answers your other question: the manual is inside Flex Builder. 60 seconds of googling and poking around on Adobe's site says the online version of this is here: http://www.adobe.com/support/documentation/en/air/
If I had to guess how to close the main window programmatically, it would be:
this.nativeWindow.close()
from within the WindowedApplication scope, or:
Application.application.nativeWindow.close()
from anywhere else in the program.
Also, you don't have to define the function separately in this instance. That's procedural thinking. ActionScript has first-class functions:
close.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void { this.nativeWindow.close(); }); -
2. Re: Manual for AIR
duncanhall Apr 5, 2008 6:35 AM (in response to DanelKirch)Alternatively, if you're not a Flex user, the livedocs can be found here:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html
And you would want to replace ' Application' in the above post to ' NativeApplication'.
Eg:
NativeApplication.nativeApplication.activeWindow.close(); - Closes the active window
NativeApplication.nativeApplication.exit() - Exits the application

