I want to use FXG created from products like Illustrator or Fireworks within my subclassed Shape objects.
1. Create FXG file with Illustrator or Fireworks. 2. Save it to your project src/ folder. 3. You can use it like your own classes instantiated from Graphics
For example if you have NiceFlower.fxg in your /src/assets/ folder you can use it in a different way.
1. Like any other class instantiated from Graphics
<s:Group>
<assets:
NiceFlower />
</s:Group>
2. Like source for BitmapImage
<s:BitmapImage source="{
NiceFlower}" />
3. Background image
<s:BorderContainer width="300" height="300"
backgroundImage="{NiceFlower}" backgroundImageFillMode="repeat" />
4. In another graphic asset as element
<s:Graphic 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="100" height="100" xmlns:assets="assets.*"> <assets: NiceFlower /> </s:Graphic>
or as BitmapFill
<s:Rect width="300" height="300">
<s:fill>
<s:BitmapFill source="{
NiceFlower}" />
</s:fill>
</s:Rect>
+