PDA

View Full Version : Initialize first window of an app


rocker
05-14-2009, 04:27 AM
I have been using the following code to initialize my initial app window. The reason why I need to do this (or so I think) is - MyApp is my document class and hence I can not extend NativeWindow for it.

But inspite of making stage.nativeWindow.visible to false, I see MyApp window starting and then closing immediately. This obviously produces a blip when the app starts.

Any suggestions to make this better?


public class MyApp extends MovieClip
{
public function MyApp ()
{
stage.nativeWindow.visible = false;
NativeApplication.nativeApplication.autoExit = true;

// Start the main window, and close this one
new AppMainWindow();
stage.nativeWindow.close();
}
}

// Another class for the main window..
public class AppMainWindow extends NativeWindow
{
public function AppMainWindow()
{
var windowInitOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
windowInitOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
windowInitOptions.transparent = false;
windowInitOptions.resizable = true;
super(windowInitOptions);
...
...
}
}