For an application I'm creating in Adobe Air, I'd like to close the default window immediately and open a new one, then use that new window as the 'main' one (but still be able to make references to the stage).
This code closes the current window and creates a new one. How do I replace the current window with the new one?
var throwWindow:NativeWindow = this.stage.nativeWindow;
var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.systemChrome = NativeWindowSystemChrome.STANDARD;
options.type = NativeWindowType.NORMAL;
options.transparent = false;
options.resizable = false;
options.maximizable = false;
var clientWindow:NativeWindow = new NativeWindow(options);
clientWindow.activate();
throwWindow.close();
I'll summarize your question in that you would like to move your document class from one window to another.
You can actually re-parent your document class as easily as any other display object. So to movie it from one window to another you can do the following (where this
is the reference to your document class)
clientWindow.stage.addChild(this);