Table of Contents

Selection.getEndIndex( ) Method Flash 5

retrieve the index of the character following the selection in a text field
Selection.getEndIndex()

Returns

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( ).

Description

The getEndIndex( ) method identifies the end of a selection. To identify the span of characters currently selected, use both getEndIndex( ) and getBeginIndex( ).

Example

The following code extends the current selection by one character to the right:

Selection.setSelection(Selection.getBeginIndex(), Selection.getEndIndex()+1);

See Also

Selection.getBeginIndex( ), Selection.getCaretIndex( )


Table of Contents