The following example uses group to show how to fill the background color and image in flex 4:
1. Image filling method:
<S: Group x = "0" Y = "0" Height = "100%" width = "100%">
<S: rect x = "0" Y = "0" Height = "100%" width = "100%">
<S: Fill>
<S: bitmapfill source = "@ embed ('../imges/mybg.jpg')"/>
</S: Fill>
</S: rect>
</S: group>
2. Gradient filling mode:
<S: rect alpha = "0.5" x = "0" Y = "0" width = "100%" Height = "100%">
<S: Fill>
<S: lineargradient rotation = "250">
<S: gradiententry color = "0x222222" ratio = "0"/>
<S: gradiententry color = "0 xdddddddd" ratio = "1"/>
</S: lineargradient>
</S: Fill>
</S: rect>
3. Use the automatic filling mode of the bitmapimage Control
<S: Group x = "124" Y = "193" width = "308" Height = "199" id = "groupwater">
<S: bitmapimage source = "@ embed ('../images/water.jpg')" fillmode = "repeat" Height = "100%" width = "100%"/>
</S: group>
In Flex 4, the component background setting (filling mode) group is used as an example.