34
Chapter 2: Director Scripting Essentials
When the movie encounters a frame, events occur in the following order:
1
beginSprite
This event occurs only if new sprites begin in the frame.
2
stepFrame
3
prepareFrame
4
enterFrame
After
enterFrame
and before
exitFrame
, Director handles any time delays
required by the tempo setting, idle events, and keyboard and mouse events.
5
exitFrame
6
endSprite
This event occurs only if the playhead exits a sprite in the frame.
When a movie stops, events occur in the following order:
1
endSprite
This event occurs only if sprites currently exist in the movie.
2
stopMovie
For reference information on the predefined system events in Director, see
Chapter 10, “Events
and Messages,” on page 159
.
Messages
To run the appropriate set of script statements at the right time, Director must determine what is
occurring in the movie and which statements 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.
The general order in which messages are sent to objects is as follows:
1
Messages are sent first to behaviors attached to a sprite involved in the event. If a sprite has more
than one behavior attached to it, behaviors respond to the message in the order in which they
are attached to the sprite.
2
Messages are sent next to a script attached to the cast member assigned to the sprite.
3
Messages are then sent to behaviors attached to the current frame.
4
Messages are sent last to movie scripts.
Although you can define your own message names, most common events that occur in a movie
have built-in message names.
For reference information on the built-in messages in Director, see
Chapter 10, “Events and
Messages,” on page 159
.
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.
A custom message and handler name must meet the following criteria:
•
It must start with a letter.
•
It must include alphanumeric characters only (no special characters or punctuation).
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...