Mega Code Archive
Display the selections of the TextInput control when you click the button
import mx.core.IUITextField;
import flashx.textLayout.elements.TextRange;
private function initApp():void {
sparkRET.selectRange(0, 10);
}
private function getTextSelection():void {
var anchorPos:int = sparkRET.selectionAnchorPosition;
var activePos:int = sparkRET.selectionActivePosition;
myLabel.text = "Current Selection: \"" + sparkRET.text.substring(anchorPos,activePos) + "\"";
}