An event handler is akin to a specially named function that is automatically invoked when a particular event occurs. Creating an event handler is, hence, very much like creating a function, with a few twists:
Event handlers have predetermined names such as keyDown. You can't name an event handler whatever you like; you have to use the predefined names shown later in Table 10-1 and Table 10-2.
Event handlers are not declared with the function statement.
Event handlers must be attached to buttons, movie clips, or objects, not frames.
WARNING
Most events were first introduced in Flash 5. If exporting to Flash 4 format, use only the button event handlers (only button events were supported in Flash 4), and test your work carefully in the Flash 4 Player.
Copyright © 2002 O'Reilly & Associates. All rights reserved.