Skip to content

Instantly share code, notes, and snippets.

@shengoo
Last active August 29, 2015 14:00
Show Gist options
  • Save shengoo/11240171 to your computer and use it in GitHub Desktop.
Save shengoo/11240171 to your computer and use it in GitHub Desktop.
mxml fill background with color or image
<?xml version="1.0" encoding="utf-8"?>
<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" width="400" height="300">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:HGroup width="100%" height="100%">
<s:Group width="50%" height="100%">
<s:Rect width="100%" height="100%"
horizontalCenter="0"
verticalCenter="0"
topLeftRadiusX="5"
topLeftRadiusY="5"
topRightRadiusX="5"
topRightRadiusY="5">
<s:fill>
<s:BitmapFill fillMode="repeat" source="@Embed(source='flag.png')"/>
</s:fill>
</s:Rect>
</s:Group>
<s:Group width="50%" height="100%">
<s:Rect width="100%" height="100%"
horizontalCenter="0"
verticalCenter="0"
topLeftRadiusX="5"
topLeftRadiusY="5"
topRightRadiusX="5"
topRightRadiusY="5">
<s:fill>
<s:SolidColor alpha="0.5" color="#8811dd"/>
</s:fill>
</s:Rect>
</s:Group>
</s:HGroup>
</s:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment