Working with Text Field Selections

When a user selects a portion of a dynamic or user-input text field, the positions of the selected characters are stored in a special built-in object called the Selection object. Using the Selection object, we can check which part of a text field a user has selected or even select a part of a text field programmatically. The Selection object can also tell us which of a series of text fields is currently selected by the user. Finally, we can use the Selection object to give keyboard focus to a particular text field, prompting a user to type in a suggested location.

To learn how to work with text field selections, see the Selection object in Part III.

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.