Q:

Background Image in Flex

I'm using Flash Builder 4 to create an application. I need to set an background image for the app. I've pulled through the data from XML.
I am using an <mx:Image> for the background-image. But I need elements to then be added inside it. How do I achieve this? I considered using Layers, but dont know how you achieve this.
Any help appreciated.
Cheers

A:

One approach: in our flex application, we have a canvas behind our primary container as in
<mx:Canvas id="bgImg" width="1280" height="800"
           backgroundImage="assets/background.jpg" />
<containers:FlashContainer id="mainContainer">
<!-- HBoxs, VBoxes and loads of other components -->
</containers:FlashContainer>

So, the other elements you're looking to add would exist within the internal container with a stationary Canvas "behind" it, which holds your image.
To get this to work in Flex 4 you need to compile with the Halo theme (instead of Spark).  We use flex builder and set the following flag under the project compiler preferences.
-theme=${flexlib}/themes/Halo/halo.swc

As in the following image:

