Name
Selection.getEndIndex( ) Method — retrieve the index of the last selected character
Availability
Flash 5
Synopsis
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( )
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access