Selection.getEndIndex( ) Method | Flash 5 |
retrieve the index of the character following the selection in a text field |
The index of the character after the last character in the current selection (highlighted block of text). If no text field has focus, it returns -1. If a text field has focus but no characters are selected, it returns the value of Selection.getCaretIndex( ).
The getEndIndex( ) method identifies the end of a selection. To identify the span of characters currently selected, use both getEndIndex( ) and getBeginIndex( ).
The following code extends the current selection by one character to the right:
Selection.setSelection(Selection.getBeginIndex(), Selection.getEndIndex()+1);
Selection.getBeginIndex( ), Selection.getCaretIndex( )