AIR: List of all opened windows

I was hunting around today for all opened windows in my application. Seemed obvious enough and something Adobe would have included in the environment — and they did. But it was not something simple to find a reference to, so I thought I’d throw this post out there in the ether. Maybe someone else will find it useful.

 

var windows:Array = NativeApplication.nativeApplication.openedWindows;

 

image

 

Beautiful. And this opens up some other interesting possibilities:

 

Represents this native AIR application.

The NativeApplication class provides application information, application-wide functions, and dispatches application-level events.

NativeApplication is a singleton object, created automatically at application startup. Get the NativeApplication instance of an application with the static property NativeApplication.nativeApplication.

(from the api)

 

There are some interesting items in there:

 

Of course I was already using several of these for my tray-icon and menus and such, but I didn’t know the window list was in here too.

Leave a Reply