• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Controlling Text > Controlling the Focus of Text Fields

Controlling the Focus of Text Fields

You can have only one focused object on the Stage at any time. If you have multiple text fields on the Stage, you need to be able to control which one is focused before you can retrieve or assign the insertion-point location or selection. The getFocus() and setFocus() methods of the Selection object let you do this.

The method getFocus() returns a string of the absolute path to the text field by using the _level0 term. If the selected text field called yourName is on the root Timeline, for example, and you call the getFocus() method, the returned value is: “_level0.yourName”.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint