Flex Gumbo中如何利用repeat属性重复填充BitmapGraphic对象的例子
By Minidxer | June 5, 2009
接下来的例子演示了Flex Gumbo中如何利用repeat属性,重复填充BitmapGraphic对象。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <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>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
BitmapGraphic, Gumbo |
No Comments » |
873 views
Tags: BitmapGraphic, Gumbo, repeat