The following example shows how you can set the background image on an Adobe AIR WindowedApplication container by setting the backgroundImage style.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2009/02/05/setting-a-background-image-on-a-windowedapplication-container-in-adobe-air/ --> <mx:WindowedApplication name="WindowedApplication_backgroundImage_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" backgroundImage="mx.skins.halo.ApplicationBackground" backgroundSize="100%"> <mx:Label text="backgroundImage = mx.skins.halo.ApplicationBackground" /> </mx:WindowedApplication>
You can also set the backgroundImage style in an external .CSS file or <Style> block, as seen in the following example:
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2009/02/05/setting-a-background-image-on-a-windowedapplication-container-in-adobe-air/ --> <mx:WindowedApplication name="WindowedApplication_backgroundImage_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle"> <mx:Style> WindowedApplication { backgroundColor: white; backgroundImage: ClassReference("mx.skins.halo.ApplicationBackground"); } </mx:Style> <mx:Label text="backgroundImage = mx.skins.halo.ApplicationBackground" /> </mx:WindowedApplication>
{ 0 comments… add one now }