
Selection.getEndIndex() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
750
|
ActionScript Language Reference
Selection.getEndIndex() Method
retrieve the index of the character following the selection in a text field
Flash 5
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 charac-
ters are selected, it returns the value of Selection.getCaretIndex().
Description
The getEndIndex() method identifies the end of a selection. To identify the span of charac-
ters 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()
Selection.getFocus() Method
identify the currently focused button, movie clip, or text field
Flash 5; enhanced in Flash 6 to support buttons and movie clips
Selection.getFocus()
Returns
A string indicating the full path to the object that has keyboard focus (for example,
"_level1.theField_txt" or "_level0.listBox_mc"). If no button, movie clip, or text field
currently has keyboard focus, it returns
null.
Description
The getFocus() method ...