RichTextEditor Control With Formatted Text : RichTextEditor « Components « Flex






RichTextEditor Control With Formatted Text

RichTextEditor Control With Formatted Text
     

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- textcontrols/RichTextEditorControlWithFormattedText.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
    <!-- The HTML text string used to populate the RichTextEditor control's 
        TextArea subcomponent. The text is on a single line. -->
    <fx:Script> 
        [Bindable] 
        public var htmlData:String="<textformat leading='2'><p align='center'><b><font size='20'>HTML Formatted Text</font></b></p></textformat><br><textformat leading='2'><p align='left'><font face='_sans' size='12' color='#000000'>This paragraph contains<b>bold</b>, <i>italic</i>, <u>underlined</u>, and <b><i><u>bold italic underlined </u></i></b>text.</font></p></textformat><br><p><u><font face='arial' size='14' color='#ff0000'>This a red underlined 14-point arial font with no alignment set.</font></u></p><p align='right'><font face='verdana' size='12' color='#006666'><b>This a teal bold 12-pt.' Verdana font with alignment set to right.</b></font></p><br><li>This is bulleted text.</li><li><font face='arial' size='12' color='#0000ff'><u> <a href='http://www.adobe.com'>This is a bulleted link with underline and blue color set.</a></u></font></li>"; </fx:Script>
    <!-- The RichTextEditor control. To reference a subcomponent prefix its ID with the RichTextEditor control ID. -->
    <mx:RichTextEditor id="rte1" backgroundColor="#ccffcc" width="500"
        title="Rich Text Editor" htmlText="{htmlData}"
        initialize="rte1.textArea.setStyle('backgroundColor', '0xeeffee')" />
</s:Application>

   
    
    
    
    
  








Related examples in the same category

1.On value commit in a RichTextEditor, display value by reference its idOn value commit in a RichTextEditor, display value by reference its id
2.Fade RichTextEditorFade RichTextEditor
3.Change style for textArea in RichTextEditorChange style for textArea in RichTextEditor
4.htmltext with cdata inside RichTextEditor
5.Use RichTextEditor to display HTML formatted stringUse RichTextEditor to display HTML formatted string
6.Get Number of characters selected from RichTextEditorGet Number of characters selected from RichTextEditor
7.Get font family for selected text in RichTextEditorGet font family for selected text in RichTextEditor
8.Get font size for selected text in RichTextEditorGet font size for selected text in RichTextEditor
9.Get color for selected text in RichTextEditorGet color for selected text in RichTextEditor
10.Replace text in RichTextEditor with TextRangeReplace text in RichTextEditor with TextRange
11.Creating a RichTextEditor control with Creating a RichTextEditor control with <mx:RichTextEditor>
12.Bind String to html Text property of RichTextEditorBind String to html Text property of RichTextEditor
13.RichTextEditor initialize eventRichTextEditor initialize event
14.creationComplete event for RichTextEditorcreationComplete event for RichTextEditor
15.Color picker for RichTextEditorColor picker for RichTextEditor
16.Remove the alignment buttons from a RichTextEditor controlRemove the alignment buttons from a RichTextEditor control
17.toolbar from RichTextEditortoolbar from RichTextEditor
18.Use the RichTextEditorUse the RichTextEditor
19.Set RichTextEditor to use system fontSet RichTextEditor to use system font
20.Compare the text and html text in RichTextEditorCompare the text and html text in RichTextEditor
21.Bind html text in RichTextEditor to TextAreaBind html text in RichTextEditor to TextArea
22.RichTextEditor CDATARichTextEditor CDATA
23.RichTextEditor ControlRichTextEditor Control
24.RichTextEditor SubcontrolRichTextEditor Subcontrol
25.Remove Align Buttons from RichTextEditor's ToolBarRemove Align Buttons from RichTextEditor's ToolBar