import mx.controls.Alert;
private function showSelectedText():void
{
var beginIndex:int = myInput.selectionBeginIndex;
var endIndex:int = myInput.selectionEndIndex;
var selectedText:String = myInput.text.substring(beginIndex, endIndex);
myInput.setFocus();
myInput.selectionBeginIndex = beginIndex;
myInput.selectionEndIndex = endIndex;
Alert.show(selectedText, "Selected Text");
}