AS3 AIR ScreenManagerA multi-screen AIR application manager Never wondered how cool it would be when your AIR application runs on 2 or more screens at the same time? Adobe AIR supports multi-screen by offering the developer a Screen-class. This class makes it possible to detect screens, get some info, and that's it. To open a window on a screen, you'll have to do some calculations yourself. To make positioning screens, moving screens, ... easier , I quickly build a ScreenManager that takes care of your NativeWindow(s). Make an instance of the nativewindow and send it throught the manager. Like this: var nw:NativeWindow=new NativeWindow(new NativeWindowInitOptions());
nw.width=250;
nw.height=90;
var mc:MovieClip=new MovieClip(); //movieclip with content
nw.stage.addChild(mc);
ScreenManager.openWindowCenteredOnScreen(nw,2); The ScreenManager is a static class. It allow the developer to control a NativeWindow through the following methods: (incorrect signatures) - ScreenManager.centerWindowOnScreen()
- ScreenManager.getActualScreenBounds()
- ScreenManager.getScreenColorDepth()
- ScreenManager.getVisibleScreenBounds()
- ScreenManager.moveWindow()
- ScreenManager.openWindowCenteredOnScreen()
- ScreenManager.openWindowOnScreen()
- ScreenManager.stretchWindowToAllScreens()
- ScreenManager.stretchWindowOnScreen()
- ScreenManager.openWindowFullScreenOn()
- ScreenManager.setWindowFullScreenOn()
- ScreenManager.moveWindowToCorner()
- ScreenManager.openWindowInCorner()
and the following properties: - ScreenManager.mainScreenIndex
- ScreenManager.numScreens
- ScreenManager.maximumAvailableResolution
The ScreenManager can be downloaded here . UpdateThe ScreenManager class is extended with new methods to place your application in a corner on a given screen (for eaxample: bottom-right corner of the 2nd screen)
|