Flex Gumbo中如何给FxTextInput背景颜色增加FxAnimateColor效果的例子
By Minidxer | July 22, 2009
接下来的例子演示了Flex Gumbo中如何给FxTextInput背景颜色增加FxAnimateColor效果。
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0"?>
- <FxApplication name="FxTextInput_contentBackgroundColor_FxAnimateColor_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- backgroundColor="white">
- <layout>
- <BasicLayout />
- </layout>
- <Script>
- <![CDATA[
- private function textInput_focusIn(evt:FocusEvent):void {
- colorEffect.play([evt.currentTarget]);
- }
- private function textInput_focusOut(evt:FocusEvent):void {
- colorEffect.stop();
- evt.currentTarget.setStyle("contentBackgroundColor", "white");
- }
- ]]>
- </Script>
- <Declarations>
- <FxAnimateColor id="colorEffect"
- colorPropertyName="contentBackgroundColor"
- colorFrom="0xFFFFFF"
- colorTo="0xFF0000"
- repeatBehavior="reverse"
- repeatCount="0"
- duration="500" />
- </Declarations>
- <VGroup horizontalCenter="0" verticalCenter="0">
- <FxTextInput id="textArea1"
- text="The quick brown fox jumps over the lazy dog."
- focusIn="textInput_focusIn(event);"
- focusOut="textInput_focusOut(event);" />
- <FxTextInput id="textArea2"
- text="The quick brown fox jumps over the lazy dog."
- focusIn="textInput_focusIn(event);"
- focusOut="textInput_focusOut(event);" />
- <FxTextInput id="textArea3"
- text="The quick brown fox jumps over the lazy dog."
- focusIn="textInput_focusIn(event);"
- focusOut="textInput_focusOut(event);" />
- </VGroup>
- </FxApplication>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FxTextInput, Gumbo |
1 Comment » |
Tags: contentBackgroundColor, Gumbo
Hi, How can I change the selection chars BackgroundColor?
Ths.