Flex Gumbo中如何利用FxAnimateColor类在两种颜色切换过程中加入动画效果的例子
By Minidxer | May 17, 2009
接下来的例子演示了Flex Gumbo中如何利用FxAnimateColor类,在两种颜色切换过程中加入动画效果。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <FxApplication name="FxAnimateColor_test"
- xmlns="http://ns.adobe.com/mxml/2009">
- <Declarations>
- <FxAnimateColor id="fxAnimateColor"
- colorFrom="{color1.selectedColor}"
- colorTo="{color2.selectedColor}"
- target="{ellipse.fill}" />
- </Declarations>
- <Form>
- <FormItem label="colorFrom:">
- <ColorPicker id="color1"
- selectedColor="red" />
- </FormItem>
- <FormItem label="colorTo:">
- <ColorPicker id="color2"
- selectedColor="blue" />
- </FormItem>
- <FormItem>
- <Button id="btn"
- label="Play"
- click="fxAnimateColor.play();" />
- </FormItem>
- </Form>
- <Ellipse id="ellipse"
- width="300"
- height="200"
- horizontalCenter="0"
- verticalCenter="0">
- <fill>
- <SolidColor />
- </fill>
- </Ellipse>
- </FxApplication>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FxAnimateColor, Gumbo |
No Comments » |
756 views
Tags: colorFrom, colorTo, FxAnimateColor, Gumbo