Writing Scripts with Lingo
395
Using Lingo keywords for handler names can create confusion. Although it is possible to
explicitly replace or extend the functionality of a Lingo element by using it as a handler name, this
should be done only in certain advanced situations.
When you have multiple handlers with similar functions, it is useful to give them names that have
similar beginnings so they appear together in an alphabetical listing, such as the listing that can be
displayed by the Edit > Find > Handler command.
Understanding the order of messages in a movie
Director follows a definite order when sending messages about events that occur during the
course of a movie.
When the movie first starts, events occur in the following order:
1
prepareMovie
2
beginSprite
This event occurs when the playhead enters a sprite span.
3
prepareFrame
Immediately after the
prepareFrame
event, Director plays sounds, draws sprites, and
performs any transitions or palette effects. This event occurs before the
enterFrame
event.
An
on prepareFrame
handler is a good location for Lingo that you want to run before the
frame draws.
4
startMovie
This event occurs in the first frame that plays.
When Director plays 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
Immediately after the
prepareFrame
event, Director plays sounds, draws sprites, and performs
any transitions or palette effects. This event occurs before the
enterFrame
event.
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
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...