In a previous example, “Opening a new Window in Adobe AIR”, we saw how you could launch a new Flex Window container in Adobe AIR by creating a custom Window component and calling the open() method.

The following example shows how you can launch a new “normal” or “utility” NativeWindow container in Adobe AIR by creating a NativeWindowInitOptions object, specifying the type property to one of the static constants in the NativeWindowType class, and passing the NativeWindowInitOptions object to the NativeWindow constructor.

And from the documentation:

Constants for the valid values of this property are defined in the NativeWindowType class:

  • NativeWindowType.NORMAL — A typical window. Normal windows use full-size chrome and appear on the Windows task bar and the Mac OS X window menu.
  • NativeWindowType.UTILITY — A tool palette. Utility windows use a slimmer version of the system chrome and do not appear on the Windows task bar and the Mac OS-X window menu.
  • NativeWindowType.LIGHTWEIGHT — lightweight windows cannot have system chrome and do not appear on the Windows task bar and the Mac OS X window menu. In addition, lightweight windows do not have the System (Alt-Space) menu on Windows. Lightweight windows are suitable for notification bubbles and controls such as combo-boxes that open a short-lived display area. When the lightweight type is used, systemChrome must be set to none.




    
    
        
    
    
        
        
    
    
    
    

Due to popular demand, here is the “same” example in a more ActionScript friendly format:




    
    
        
    

Tagged with:
 

2 Responses to Opening a new NativeWindow in Adobe AIR

  1. Thanks for the simple examples.

  2. Rich Gartland says:

    Hi, I’m doing something similar but have a problem I hope you can help with. I’m opening a new utility window and closing my original window (to avoid a taskbar slot being used up). I move my canvas over while creating the new window, so all my controls make it safely there. But later, I’d like to have a button that will resize the new window so I can expose some preference controls. So far I haven’t had any luck with trying to just resize the size using the equivalent of “win.height = …” code from your example. Ideas?

Leave a Reply