A Director movie may be thought of as a series of events ”things that happen on the Stage or in the Score. Some events are automatic, such as the playhead entering a new frame. Other events are user -initiated ”for example, a click of the mouse button or the pressing of a key on the keyboard. Whenever an event occurs, Director generates a one-word message acknowledging the event. (For example, when the mouse button is released, Director generates the message " mouseUp .") The user doesn't see these messages; they're solely for internal communication within Director. Table 15.1 shows a list of common events that can occur while a movie is playing and the messages those events generate. Table 15.1. Movie events and Lingo messages
You can give Director specific instructions about how you want it to handle (respond to) a particular message. That set of instructions is called a handler . Handlers are the building blocks of Lingo scripts. Every handler has three parts ( Figure 15.3 ): Figure 15.3. Every handler has three parts: The first line specifies the event that triggers the handler, the body lists commands that should be executed, and the last line concludes the handler.
(Note: For convenience, handlers are often described as responding to ”or being triggered by ”events in a movie. There's nothing wrong with using this informal shorthand, as long as you realize that handlers technically respond to the messages generated by events, not to the events themselves .) |