Chapter 11. Events

 

This chapter covers

  • Working with events
  • Listening for events
  • Dispatching events
  • Creating custom events

Events are central to understanding how to work with Flex and how to create compelling, well-designed applications. Events are a powerful tool and one of the main features of the Flash Player.

Events are deceptively simple, but at the same time, they’re an extremely powerful communication mechanism for your applications. We’ve mentioned several times that Flex is built around an event-driven framework. Events are the central nervous system within your applications, with information flowing in and out of them, up and down, and side to side. We don’t mean to be melodramatic, but if you don’t understand events, Flex becomes a terrible chore and ActionScript 2.0 begins to look sexy again.

Let’s begin by introducing the event system and describing its all-important role in a Flex application. Next we explore integrating native and custom events in an application while gaining an understanding of event nuances.

11.1. The event system

11.2. Sending and receiving events

11.3. Custom events

11.4. Summary