Components Flex


    height="500">
    
        import mx.controls.textClasses.TextRange;
        [Bindable]
        
        public var htmlData:String="HTML Formatted Text

";
        public function changeSelectionText():void {
            var sel:TextRange = rte1.selection;
            var selLength:int = sel.endIndex - sel.beginIndex;
            if (selLength) {
                sel.text="This is replacement text. "
                sel.color="fuchsia";
                sel.fontSize=20;
                sel.fontFamily="courier"
                t1.text+="\n\nNew text length: " + String(sel.endIndex - sel.beginIndex);
                t1.text+="\nNew Font Family: " + sel.fontFamily;
                t1.text+="\nNew Font Size: " + sel.fontSize;
                t1.text+="\nNew Font Color: " + sel.color;                
            }
        }
      

            height="100%" mouseUp="changeSelectionText()" />
            fontWeight="bold" width="300" height="180" />