<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top"
horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html">
<!--这个例子是一个简单的富文本编辑器,标题应用了style样式-->
<mx:Script>
<![CDATA[
//是不是在同一文件内就可访问private声明的变量?
private var richText:String = "Enter text into the <b>RichTextEditor control</b>, then click a <b><font color='#0050AA'>button</font></b> to display your text as <i>plain text</i>, or as <i>HTML-formatted</i> text.";
]]>
</mx:Script>
<mx:Style>
.white{
color: #ffffff;
fontWeight: bold;
}
</mx:Style>
<mx:RichTextEditor titleStyleName="white" id="rte" title="RichTextEditor" width="70%" height="150"
borderAlpha="0.15" creationComplete="rte.htmlText=richText;" />
<mx:TextArea id="rteText" width="70%" height="50" />
<mx:HBox>
<mx:Button color="black" label="Show Plain Text" click="rteText.text=rte.text;"/><!--添加动作-->
<mx:Button color="black" label="Show HTML Markup" click="rteText.text=rte.htmlText;"/>
</mx:HBox>
</mx:Application>