This paragraph contains bold, italic, underlined, and bold italic underlined text.
a red t.
This a teal bold 12-pt. Verdana font with alignment set to right.
"; public function changeSelectionText():void { //Get a TextRange with the selected text and find its length. var sel:TextRange = rte1.selection; var selLength:int = sel.endIndex - sel.beginIndex; //Do the following only if the user made a selection. if (selLength) { //Display the selection size and font color, size, and family. t1.text="Number of characters selected: " + String(selLength); t1.text+="\n\nOriginal Font Family: " + sel.fontFamily; t1.text+="\nOriginal Font Size: " + sel.fontSize; t1.text+="\nOriginal Font Color: " + sel.color; //Change font color, size, and family and replace selected text. sel.text="This is replacement text. " sel.color="fuchsia"; sel.fontSize=20; sel.fontFamily="courier" //Show the new font color, size, and family. 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; } }