Chapter 16
394
Using messages to identify events
To run the appropriate set of Lingo statements at the right time, Director must determine what is
occurring in the movie and which Lingo to run in response to certain events.
Director sends messages to indicate when specific events occur in a movie, such as when sprites
are clicked, keyboard keys are pressed, a movie starts, the playhead enters or exits a frame, or a
script returns a certain result. Handlers within scripts contain instructions that run when a
specific message is received.
Although you can define your own message names (see “Defining custom messages”
on page 394), most common events that occur in a movie have built-in message names. See the
following categories in the “Lingo by Feature” section of the Lingo Dictionary for the built-in
messages that describe events.
•
Keyboard and mouse events.
•
Frame events.
•
Browser and Internet events.
•
Sprite events.
•
Movie in a window (MIAW) events.
•
Movie events.
•
Synchronizing media events.
•
Idle events.
•
Timeout events.
•
Authoring behavior events.
Defining custom messages
In addition to using built-in message names, you can define your own messages and
corresponding handler names. A custom message can call another script, another handler, or
the statement’s own handler. When the called handler stops executing, the handler that called
it resumes.
Director can send a custom message from any location. The message is first available to handlers
in the script from which the message was sent. If no handler is found, the message is available to
movie scripts.
If more than one movie script contains a handler for the message, the handler in the movie script
that has the lowest cast member number is executed.
A custom handler name must meet the following criteria:
•
It must start with a letter.
•
It must include alphanumeric characters only (no special characters or punctuation).
•
It must consist of one word or of several words connected by an underscore—no spaces
are allowed.
•
It must be different from the name of any predefined Lingo element.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...