
on enterFrame
169
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 exitFrame
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
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 you explicitly instruct the movie otherwise), put
the
on enterFrame
handler in a movie script. The handler executes every time the playhead
enters a frame unless the frame script has its own handler. If the frame script has its own
handler, the
on enterFrame
handler in the frame script overrides the
on enterFrame
handler
in the movie script.
The order of frame events is
stepFrame
,
prepareFrame, enterFrame
, and
exitFrame
.
This event is passed the object reference
me
if used in a behavior.
Содержание 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...