Selection


Object
    |
    +-Selection

public class Selection
extends Object

The Selection class lets you set and control the text field in which the insertion point is located (that is, the field that has focus). Selection-span indexes are zero-based (for example, the first position is 0, the second position is 1, and so on).

There is no constructor function for the Selection class, because there can be only one currently focused field at a time.

Availability: ActionScript 1.0; Flash Player 5

Property summary

Properties inherited from class Object

constructor, __proto__, prototype, __resolve


Event summary

Event

Description

onSetFocus = function([oldfocus:Object], [newfocus:Object]) {}

Notified when the input focus changes.

Method summary

Modifiers

Signature

Description

static

addListener(listener:Object) : Void

Registers an object to receive keyboard focus change notifications.

static

getBeginIndex() : Number

Returns the index at the beginning of the selection span.

static

getCaretIndex() : Number

Returns the index of the blinking insertion point (caret) position.

static

getEndIndex() : Number

Returns the ending index of the currently focused selection span.

static

getFocus() : String

Returns a string specifying the target path of the object that has focus.

static

removeListener(listener:Object) : Boolean

Removes an object previously registered with Selection.addListener().

static

setFocus(newFocus:Object) : Boolean

Gives focus to the selectable (editable) text field, button, or movie clip, specified by the newFocus parameter.

static

setSelection(beginIndex:Number, endIndex:Number) : Void

Sets the selection span of the currently focused text field.

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch



Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002651.html