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

Chapter 10. Controlling Text > Controlling the Selection Within Text Boxes

Controlling the Selection Within Text Boxes

You can control the selection or cursor position inside editable text boxes. This lets you direct your viewers'attention to particular characters or words they've entered, perhaps to point out errors or misspellings. It also lets you keep track of the cursor position, much like the way the _xmouse and _ymouse properties let you keep track of the location of the viewer's mouse pointer.

The position of each character in a string is numbered and used as the index for the methods of the Selection object. The first character is assigned the index of 0, the second character is 1, and so on. If a cursor isn't positioned within a text box when Flash retrieves the selection index, it returns a value of –1.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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