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

Events and Event Handlers

Events are things that happen that Flash can recognize and respond to. A button click is an event, as are button rollovers, mouse movements, and key presses on the keyboard. Events can also be things that the user cannot control. The completion of a sound, for example, is also an event. Events can even occur regularly.

With all these events happening, you need a way to detect and respond to them. Event handlers are statements that perform this task. Event handlers perform certain actions as a response to events. You can create an event handler to detect a click of a button, for example. In response, you can make Flash go to another frame in a different scene.

Event handlers are associated with particular Flash classes. Button presses, rollovers, and releases are associated with the Button class. The pressing of a key is associated with the Key class. And the completion of a sound is associated with the Sound class. You will learn about all these events as you learn about the classes themselves. You’ll begin with the Button class.

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