flex gumbo实例:重复填充BitmapGraphic对象
你首先需要学会在FLEX BUILDER3中编写,编译gumbo的方法: 这里有教程:http://www.cnblogs.com/xxcainiao/archive/2008/11/24/1339865.html
gumbo教程--BitmapGraphic对象
代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/12/13/repeating-the-fill-on-a-bitmapgraphic-object-in-flex-gumbo/ -->
<Application name="BitmapGraphic_repeat_test"
xmlns="http://ns.adobe.com/mxml/2009"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<ApplicationControlBar dock="true">
<Form styleName="plain">
<FormItem label="repeat:">
<CheckBox id="checkBox" />
</FormItem>
<FormItem label="width:">
<HSlider id="widthSlider"
minimum="100"
maximum="500"
value="300"
snapInterval="1"
tickInterval="50"
liveDragging="true" />
</FormItem>
<FormItem label="height:">
<HSlider id="heightSlider"
minimum="100"
maximum="300"
value="200"
snapInterval="1"
tickInterval="50"
liveDragging="true" />
</FormItem>
</Form>
</ApplicationControlBar>
<Graphic>
<BitmapGraphic id="bitmapGr"
source="@Embed('assets/fx_appicon-tn.gif')"
repeat="{checkBox.selected}"
width="{widthSlider.value}"
height="{heightSlider.value}" />
</Graphic>
</Application>
<!-- http://blog.flexexamples.com/2008/12/13/repeating-the-fill-on-a-bitmapgraphic-object-in-flex-gumbo/ -->
<Application name="BitmapGraphic_repeat_test"
xmlns="http://ns.adobe.com/mxml/2009"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<ApplicationControlBar dock="true">
<Form styleName="plain">
<FormItem label="repeat:">
<CheckBox id="checkBox" />
</FormItem>
<FormItem label="width:">
<HSlider id="widthSlider"
minimum="100"
maximum="500"
value="300"
snapInterval="1"
tickInterval="50"
liveDragging="true" />
</FormItem>
<FormItem label="height:">
<HSlider id="heightSlider"
minimum="100"
maximum="300"
value="200"
snapInterval="1"
tickInterval="50"
liveDragging="true" />
</FormItem>
</Form>
</ApplicationControlBar>
<Graphic>
<BitmapGraphic id="bitmapGr"
source="@Embed('assets/fx_appicon-tn.gif')"
repeat="{checkBox.selected}"
width="{widthSlider.value}"
height="{heightSlider.value}" />
</Graphic>
</Application>
原文:http://blog.flexexamples.com/2008/12/13/repeating-the-fill-on-a-bitmapgraphic-object-in-flex-gumbo/