![MACROMEDIA DIRECTOR MX 2004 Reference Download Page 172](http://html1.mh-extra.com/html/macromedia/director-mx-2004/director-mx-2004_reference_687516172.webp)
172
Chapter 10: Events and Messages
on exitFrame
Usage
-- Lingo syntax
on exitFrame
statement
(
s
)
end
// JavaScript syntax
function exitFrame() {
statement
(
s
);
}
Description
System message and event handler; contains statements that run each time the playhead exits the
frame that the
on exitFrame
handler is attached to. The
on exitFrame
handler is a useful place
for Lingo that resets conditions that are no longer appropriate after leaving the frame.
Place
on exitFrame
handlers in behavior, frame, or movie scripts, as follows:
•
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 explicitly instructed otherwise, put the handler in a
movie script. The
on exitFrame
handler then executes every time the playhead exits the frame
unless the frame script has its own
on exitFrame
handler. When the frame script has its own
on exitFrame
handler, the
on exitFrame
handler in the frame script overrides the one in the
movie script.
This event is passed the sprite script or frame script reference
me
if it is used in a behavior. The
order of frame events is
prepareFrame
,
enterFrame
, and
exitFrame
.
Example
This handler turns off all puppet conditions when the playhead exits the frame:
-- Lingo syntax
on exitFrame me
repeat with i = 48 down to 1
sprite(i).scripted = FALSE
end repeat
end
// JavaScript syntax
function exitFrame() {
for (i=48; i>=1; i--);
sprite(i).scripted = false;
}
}
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...