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>

2 Responses to Setting a background image on a WindowedApplication container in Adobe AIR

  1. casey says:

    where’s the link to the image?

  2. Gaston says:

    No full code after the jump?

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam Protection by WP-SpamFree