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

Chapter 10. Controlling Text > Detecting Changes in the Text Field

Detecting Changes in the Text Field

Often, you’ll want to capture information from a text field only when the viewer has entered something new. Or you’ll want to respond when a viewer has selected a particular text field. You can detect these changes in text fields with event handlers and listeners. Flash provides a variety of them through the Selection object and the TextField object (Table 10.4).

Selection and TextField Events
Event Description
onSetFocus Happens when a new text field receives focus. When used as a TextField event, the handler can take one parameter: oldFocus. When used as a Selection event, the handler can take two parameters—oldFocus and newFocus—and requires a listener.
onChanged Happens when the contents of a text field change. This TextField event can also be assigned to a listener.
onScroller Happens when one of the text-field properties—scroll or hscroll—changes. This TextField event can also be assigned to a listener.
onKillFocus Happens when a text field loses focus. The handler for this TextField event can take one parameter: newFocus.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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