Detecting the current system chrome setting in an Adobe AIR application
The following example show show you can detect the current system chrome setting in an Adobe AIR application by using the read-only systemChrome property and the static constants in the NativeWindowSystemChrome class.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2008/12/25/detecting-the-current-system-chrome-setting-in-an-adobe-air-application/ --> <mx:WindowedApplication name="WindowedApplication_systemChrome_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" initialize="init();"> <mx:Script> <![CDATA[ import flash.display.NativeWindowSystemChrome; private function init():void { lbl.text = application.systemChrome; switch (application.systemChrome) { case NativeWindowSystemChrome.ALTERNATE: lbl2.text = "Specifies that the window should display the alternate chrome style (on systems that support alternate chrome). To detect whether a host system supports alternate chrome, use NativeWindowCapabilities.hasAlternateSystemChrome."; break; case NativeWindowSystemChrome.NONE: lbl2.text = "No system chrome."; break; case NativeWindowSystemChrome.STANDARD: lbl2.text = "The standard chrome for the host operating system.\nUse this setting to emulate the look and feel of the native operating system."; break; default: lbl2.text = "Don't look at me, I'm hideous!"; break; } } ]]> </mx:Script> <mx:VBox> <mx:Label id="lbl" fontSize="72" /> <mx:Text id="lbl2" width="100%" /> </mx:VBox> </mx:WindowedApplication>
To set the system chrome in an Adobe AIR application, edit the application’s XML file:
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. --> <systemChrome>none</systemChrome>
http://get.adobe.com/air/- Platform ActionScript Language Reference
Recent Posts
- Detecting the number of screens on a users system in Adobe AIR
- Opening a new NativeWindow in Adobe AIR
- Detecting the line-ending character sequence used by the host operating system in Adobe AIR
- Displaying a custom title bar icon in a WindowedApplication container in Adobe AIR
- Setting a custom text style on the status bar on a WindowedApplication container in Adobe AIR
- Keeping a WindowedApplication on top of other windows in Adobe AIR
- Specifying whether a new Window is focused in Adobe AIR
- Opening a new Window in Adobe AIR
- Setting the file size display mode in the Flex FileSystemDataGrid control in Adobe AIR
- Sorting the FileSystemDataGrid control by date in Adobe AIR
Archives
- March 2010 (10)
- February 2009 (3)
- January 2009 (6)
- December 2008 (44)