Uses of multiple windows in AIR

For years, I’ve wanted to add one feature to the Flash Player: support for multiple windows. The feature really only makes sense when dealing with desktop apps, and I’ve been lucky enough to add the feature for AIR.
One aspect of multiwindow programming is key to making the whole package fun to use. But it’s a subtle thing and not many people know it. There’s no artificial barrier between your windows. The code you associate with your windows can all exist in the same “namespace” (they’re called ClassLoaders in Java; ApplicationDomains in AS3).
There’s no need to have a separate SWF or HTML file for each window. It’s much cleaner to just create windows as needed and populate them with DisplayObjects.
We haven’t seen many examples yet, but I believe this rich programming model will lead to even richer interactions. Let’s brainstorm some of the cool ways windows can be used.
Splash Screen: When the app launches, an attractive splash screen fades in in the middle of the screen. A nice opportunity to establish branding while also giving startup progress feedback to the user.
Tear-off Tabs: grab a tab and drag it out of the window. A translucent image shows where a new window will be created. Release the mouse button and a new window is created.
Docking Windows: As you move a window, it naturally docks to the edges of the screen and to other windows in the app. Once docked, you can move multiple windows at once. I’m thinking about Winamp and Trillian’s windows….
Auto-hide Toolbars: Already docked to the side of the screen, the window can slide offscreen when you move your mouse away. A small indicator reminds you that something’s there. When you move your mouse to the edge, the window slides back. Here I’m thinking about MS Windows Appbars, or Quicksilver’s Clipboard History window.
What else?

10 Responses to Uses of multiple windows in AIR

  1. Danilo says:

    System “toast” that slides up in above the system tray (on Windows), an example when your AIR app receives a message or an event triggers, such as IM client shows you the latest message and who sent it.
    Similar placement, but different functionality… options menus that appear above system tray icons on right click, similar to the wireless networks icon on Windows. Not sure of the top of my head if AIR support those icons, but thought I throw it out there.

  2. Kevin Hoyt says:

    I’m building an application right now where I don’t want the user to see any UI until they’ve authenticated. I guess that’d be a “Login/Auth” scenario for you.
    Kevin Hoyt
    Platform Evangelist
    Adobe Systems, Inc.

  3. enefekt says:

    “There’s no need to have a separate SWF or HTML file for each window. It’s much cleaner to just create windows as needed and populate them with DisplayObjects.”
    Now, you can’t do this with the current beta right? This is somehting that is yet to come? (Like reusing the Flex framework and code thats already loaded in your main app window, and dynamically adding a mx:Button or custom component)
    Just checking to see if I’ve missed something in the docs.

  4. I’m not sure I understand your question, enefekt.
    But it is possible with Beta1 to create new windows and populate them with custom components.
    The trick is to use the same layer of the platform stack. If you’re using AS3 without Flex (just plain ol’ DisplayObjects and Sprites), create a NativeWindow and addChild() to the window’s stage. If you’re using Flex (UIComponents, Containers, etc), create a mx.core.Window and addChild() directly to that. mx.core.Window represents both the window and the content contained in the window; it’s a Container.
    And of course you can create your own components based on mx.core.Window and just new those up instead. More on that later.

  5. enefekt says:

    OK, I think that clears it up a bit. (I haven’t done a whole lot with AIR yet).
    I was under the false impression that if you wanted to load Flex components or custom components in a new Window, that you needed to load another SWF that had that code compiled in. That you couldn’t reuse your compiled code from the SWF in the main app window.
    But it seems that using mx.core.Window instead of NativeWindow is what was needed.

  6. enefekt says:

    The AIR Beta 1 Flex guide that you download from labs is confusing. It just mentions NativeWindow and talks about loading in a SWF with the Loader class. I guess I just need to do a little more reading. I found it in the Flex 3 Language Reference and am rockin’ and rollin’.

  7. Dave says:

    what about supporting multiple displays? So far, even after talking to several Adobe developers, this doesn’t appear to be supported – I think this would open so many doors for cross-platform presentation apps!! Any idea of when this might be supported?

  8. flex1 says:

    could we use multiple window application in air and share data between them ?

  9. flex says:

    could u give examples of how multiple windows shared data between them and how to give cornor radious to other window after hidning its header

  10. flex says:

    could u give examples of how multiple windows shared data between them and how to give cornor radious to inner VBox of other window after hiding its header and tranpherent is true