Description
System message and event handler; contains statements that run after the movie preloads cast
members but before the movie does the following:
•
Creates instances of behaviors attached to sprites in the first frame that plays.
•
Prepares the first frame that plays, including drawing the frame, playing any sounds, and
executing transitions and palette effects.
New global variables used for sprite behaviors in the first frame should be initialized in the
on prepareMovie
be reset.
An
on prepareMovie
variables, plays a sound while the rest of the movie is loading into memory, or checks and adjusts
computer conditions such as color depth.
The
,
, and
go
play
Example
This handler creates a global variable when the movie starts:
-- Lingo syntax
on prepareMovie
global currentScore
currentScore = 0
end
// JavaScript syntax
function prepareMovie() {
_global.currentScore = 0;
}
See also
on
enterFrame,
on resizeWindow
Usage
-- Lingo syntax
on resizeWindow
statement(s)
end
// JavaScript syntax
function resizeWindow() {
statement(s);
}
Description
System message and event handler; contains statements that run when a movie is running as a
movie in a window (MIAW) and the user resizes the window by dragging the window's resize box
or one of its edges.
An
on resizeWindow
dimensions, such as Lingo that positions sprites or crops digital video.
190
Chapter 10: Events and Messages
handler. Global variables already set by the previous movie do not need to
handler is a good place to put Lingo that creates global variables, initializes
commands are disabled in an
updateStage
on startMovie
event handler is a good place to put Lingo related to the window's
handler.
on prepareMovie
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers