Not sure if my title accurately describes what I'm trying to do, but basically I've created a new NativeWindow as follows (using an example from the Adobe NativeWindow documentation http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/NativeWindow.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2#minSize):
var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
windowOptions.type = NativeWindowType.NORMAL;
var newWindow:NativeWindow = new NativeWindow(windowOptions);
newWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
newWindow.stage.align = StageAlign.TOP_LEFT;
newWindow.bounds = new Rectangle(100, 100, 800, 800);
newWindow.activate();
However, now that I have my new window, I want to close the old window and make the new window the active NativeApplication, basically transferring all control over to the new one. Any idea how to do this? All help greatly appreciated.
Edit:
For anyone who is interested, and thanks to the answers provided, here's what I now do. Just create an mxml file using
<?xml version="1.0" encoding="utf-8"?>
<mx:Window
xmlns:mx="http://www.adobe.com/2006/mxml"
...
>
Call this MyWindow.mxml or whatever, and then in the main controller create an instance of this using
private var myWindow:MyWindow = new MyWindow.
You can then set the height width minimizable and maximisable attributes accordingly, like myWindow.width = 400. To open the window you can then do either window.open(true) or window.visible = false; window.open(true) - the latter making the window invisible but available for use.