xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
import flashx.textLayout.elements.TextRange;
import flashx.textLayout.elements.*;
private function selectEntireLeaf(e:Event):void {
/* Get the location of the cursor. This is the character position of the
cursor in the RichEditableText control after the user clicks on it. */
var activePos:int = richTxt1.selectionActivePosition;
/* Change the color of the entire leaf under the cursor position. */
var leaf:SpanElement = richTxt1.textFlow.findLeaf(activePos) as SpanElement;
leaf.color = 0x00FF33;
}
selectable="true" editable="true" textAlign="justify"
percentWidth="100">
1) Lorem ipsum dolor sit amet, consectetur
adipiscing elit.
2) Cras posuere posuere sem, eu congue orci mattis
quis.
3) Curabitur pulvinar tellus venenatis ipsum tempus
lobortis.