1 Reply Latest reply on Dec 29, 2010 4:33 AM by Vaibhav Bhasin

    Background image instead of color

    RaúlKirm

      Hi, I have a Flex 4 application with this code:

       

       

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx"               
                     backgroundColor="#000000"
                     applicationComplete="appComp()"
                     width="1600" height="900"



      public function appComp():void{
         
          stage.scaleMode = StageScaleMode.SHOW_ALL;
          stage.align = StageAlign.TOP;
          //stage.align = StageAlign.LEFT;
         
      }


      NOTE: In the index.template.html I have change all width and heights from the default "${width}" and "${height}" to "100%"

       

       

      The documentation says of SHOW_ALL : "Borders can appear on two sides of the application."

       

      I can change the color of these borders with backgroundColor in Application tag, but....   How can I put an image (or swf) instead of these Borders?

       

      THANKS.

      Raúl.

        • 1. Re: Background image instead of color
          Vaibhav Bhasin Level 1

          Hi There,

           

          In my knowledge, there are two ways to do that.

           

          1) Create a skin for your application(I guess this option is only for advanced users) and choose the background colour there

          2) A trick which I found is take a border container and use a background image for this border container.

          e.g.:-

           

          <s:BorderContainer
            width="100%" height="100%" x="0" y="2" backgroundImage="@Embed(source='assets/images/nameofimage.jpg')">

          //other components

           

          </s:BorderContainer>

           

          Hope, it helped>>>>

          1 person found this helpful