MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 678

Actionscript language reference
Table of Contents

Advertisement

status_txt.text = "success!";
Selection.setFocus(null);
return true;
}
See also
Selection.getFocus(),
Selection.setSelection()
Availability
Flash Player 5.
Usage
Selection.setSelection(start:Number, end:Number) : Void
Parameters
The beginning index of the selection span.
start
The ending index of the selection span.
end
Returns
Nothing.
Description
Method; sets the selection span of the currently focused text field. The new selection span will
begin at the index specified in the
parameter. Selection span indexes are zero-based (for example, the first position is 0, the second
position is 1, and so on). This method has no effect if there is no currently focused text field.
Example
In the following ActionScript, you create a text field at runtime and add a string to it. Then you
focus the text field and select a span of characters in the focused text field.
this.createTextField("myText_txt", 99, 10, 10, 200, 30);
myText_txt.text = "this is my text";
Selection.setFocus("myText_txt");
Selection.setSelection(0, 3);
678
Chapter 7: ActionScript for Flash
Selection.onSetFocus
parameter, and end at the index specified in the
start
end

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents