Flex中如何通过backgroundColor样式设置RichTextEditor控件内TextArea的背景颜色的例子
By Minidxer | August 27, 2008
接下来的例子演示了Flex中如何通过backgroundColor样式,设置RichTextEditor控件内TextArea的背景颜色。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application name="RichTextEditor_backgroundColor_test"
- xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:Script>
- <![CDATA[
- import mx.events.ColorPickerEvent;
- private function colorPicker_change(evt:ColorPickerEvent):void {
- richTextEditor.textArea.setStyle("backgroundColor", evt.color);
- }
- ]]>
- </mx:Script>
- <mx:ApplicationControlBar dock="true">
- <mx:Form styleName="plain">
- <mx:FormItem label="backgroundColor:">
- <mx:ColorPicker id="colorPicker"
- selectedColor="0xFFFFFF"
- change="colorPicker_change(event);" />
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <mx:RichTextEditor id="richTextEditor" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Flex |
1 Comment » |
150 views
Tags: backgroundColor, RichTextEditor, TextArea, textAreaStyleName, 背景颜色
Trackbacks