技术点:采用样式,数据动态绑定技术
通过练习: 掌握样式用法
功能: 选中文字:进行作用样式。
演示:

源码:
<mx:Panel width="391" height="280" layout="absolute" title="文本编辑器" x="0" y="0" titleIcon="@Embed(source='image/png-0222.png')" includeInLayout="false">
<mx:Label x="10" y="10" text="字号:"/>
<mx:ComboBox x="48" y="7" width="60" id="psize" close="changeSFC(event)"></mx:ComboBox>
<mx:ComboBox x="241" y="7" width="120" id="pfont" labelField="fontName" close="changeSFC(event)"></mx:ComboBox>
<mx:ColorPicker x="162" y="9" id="pcolor" close="changeSFC(event)"/>
<mx:Label x="125" y="10" text="颜色:"/>
<mx:Label x="203" y="10" text="字体:"/>
<mx:Image source="image/left.png" x="136" y="48" name="left" click="changeAlign(event)"/>
<mx:Image source="image/middle.png" x="156" y="48" name="center" click="changeAlign(event)"/>
<mx:Image source="image/right.png" x="174" y="48" name="right" click="changeAlign(event)"/>
<mx:Button x="10" y="45" label="B" id="bold" width="40" click="changeBIU(event)"/>
<mx:Button x="51" y="45" label="I" id="italic" width="40" click="changeBIU(event)"/>
<mx:Button x="92" y="45" label="U" id="underline" width="40" click="changeBIU(event)"/>
<mx:TextArea x="11" y="75" width="351" height="133" id="myT" click="mouseDown(event)" mouseFocusChange="setAllStyle()" textAlign="left" fontFamily="Arial"/>
<mx:Label text="提供:www.beijinghome.com" x="219" y="47"/>
</mx:Panel>
