Selection.getEndIndex( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
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( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net