How to add a background image?
I just tied to code like:
.bg{
backgroundImage:Embed(source="../../assets/Interaction-Screen_BG_pump.png");
}
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
actionBarVisible="true" enterFrame="view1_enterFrameHandler(event)"
initialize="view1_initializeHandler(event)" menuKeyPressed="onMenu(event)"
overlayControls="false" tabBarVisible="true" title="Interact"
styleName="bg"
>
But it not work.
And also,how to create a image button?
To add a background image to a Flex Mobile View or app, first create your skin class (let’s call it “ViewBackgroundSkin.mxml”):
If you want the image to tile the background, set fillMode to repeat on the BitmapFill:
In your css file(let’s call it MyStyle.css) reference your skin class:
In your View, set the Style source to your css file:
or add the Style to your Application file to set the background for the whole app.