Condensing HTML white space in the RichTextEditor control in Flex

In a previous example, “Condensing HTML white space in the TextArea control in Flex”, we looked at how you could condense HTML formatted text in a TextArea control by setting the condenseWhite property.

The following example shows you how you can condense white space around HTML tags using the Flex RichTextEditor control, the htmlText property, and the condenseWhite property.

Full code after the jump.


<?xml version="1.0" encoding="utf-8"?>
<!-- -->
<mx:Application xmlns:mx=""

            private function checkBox_change(evt:Event):void {
                richTextEditor.textArea.condenseWhite = checkBox.selected;

    <mx:String id="str" source="lorem.html" />

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="condenseWhite:">
                <mx:CheckBox id="checkBox"
                        change="checkBox_change(event);" />

    <mx:RichTextEditor id="richTextEditor"
            height="100%" />


View source is enabled in the following example.

8 thoughts on “Condensing HTML white space in the RichTextEditor control in Flex

  1. Hi,Peter
    I find there’s only few fontStyle in the comboBox of TextRichEditor,can I have more option? I just mean can I add some new fonts instead of the default ones…?
    Thank you!

  2. Hello,

    This is very helpful example related to RichTextEditor …

    Developing html editor in flex but when i need to insert image,tables into RichTextEditor it is not supporting for that.

    Is there any reference for same? please advise



  3. Hey,

    You know I was under of stupid problem from last two days.Hey in just a minute u made my work easy.

    Thanks for a helpfull topic


  4. Hey,

    Is there a way to remove formatting from selected text? It’s almost like as soon as you add any formatting, you’re screwed if you want to get rid of that formatting.

Comments are closed.