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.
The Selection object is valid only when a device supports inline text entry. If a device does not support inline text entry, and instead relies on an FEP (front-end processor) to enter text, all calls to the Selection object are ignored.
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
onSetFocus = function([oldfocus], [newfocus]) {} |
Notified when the input focus changes. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
static |
addListener(listener:Object) : Void |
Registers an object to receive keyboard focus change notifications. |
|
static |
Returns a string specifying the target path of the object that has focus. |
|
|
static |
removeListener(listener:Object) : Boolean |
Removes an object previously registered with the Selection.addListener() method. |
|
static |
Gives focus to the selectable (editable) text field, button, or movie clip, that the newFocus parameter specifies. |
|
|
static |
setSelection(beginIndex:Number, endIndex:Number) : Void |
Sets the selection span of the currently focused text field. |
Methods inherited from class Object