Previously, I was trying to manage multiple native windows in an Apollo app. I found that I couldn’t add Flex components to a new window, and was dismayed. But Danny Dura came to the rescue with a sweet workaround. See the play by play here.
I’m developing a window manager to make things much easier for Apollo apps. The full window manager will be up shortly. For now, I have created a simple window manager, that wraps up the many steps necessary to create a window containing a Flex view (and clean it up on destruction!) into a really simple singleton class. The more fully-featured window manager will use this class, but it can be very helpful on its own. It makes creating new windows with Flex views a one-line operation:
var aboutWin:NativeWindow = WindowManagerSimple.getInstance().newWindow(AboutView, "About", {maximizable: false, resizable: false}, 300, 100);
You can use either a class name or a UIComponent instance for the view, and all the other parameters are optional. The window options parameter can accept a NativeWindowInitOptions object or an anonymous object of properties that override the defaults for brevity. See the source file for more info, Javadoc-styleeeee.
Next: A more complete window manager, including application and document windows. Read on.
com.partlyhuman.apollo.WindowManagerSimple View Source | Download (.ZIP, 6K)