MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 169

Director scripting reference
Table of Contents

Advertisement

Example
This handler runs when the playhead exits a sprite:
-- Lingo syntax
on endSprite me
-- clean up
gNumberOfSharks = gNumberOfSharks - 1
sound(5).stop()
end
// JavaScript syntax
function endSprite() {
// clean up
gNumberOfSharks--;
sound(5).stop();
}
See also
on
beginSprite,
on enterFrame
Usage
-- Lingo syntax
on enterFrame
statement(s)
end
// JavaScript syntax
function enterFrame() {
statement(s);
}
Description
System message and event handler; contains statements that run each time the playhead enters
the frame.
Place
on enterFrame
To assign the handler to an individual sprite, put the handler in a behavior attached to
the sprite.
To assign the handler to an individual frame, put the handler in the frame script.
To assign the handler to every frame (unless you explicitly instruct the movie otherwise), put
the
on enterFrame
enters a frame unless the frame script has its own handler. If the frame script has its own
handler, the
on enterFrame
in the movie script.
The order of frame events is
This event is passed the object reference
on exitFrame
handlers in behavior, frame, or movie scripts, as follows:
handler in a movie script. The handler executes every time the playhead
handler in the frame script overrides the
,
stepFrame
me
prepareFrame, enterFrame
if used in a behavior.
handler
on enterFrame
, and
.
exitFrame
on enterFrame
169

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Director mx 2004

Table of Contents