See also
activeWindow, close(),
(Window)
on beginSprite
Usage
-- Lingo syntax
on beginSprite
statement(s)
end
// JavaScript syntax
function beginSprite() {
statement(s);
}
Description
System message and event handler; contains statements that run when the playhead moves to a
frame that contains a sprite that was not previously encountered. Like
generated only one time, even if the playhead loops on a frame, since the trigger is a sprite not
previously encountered by the playhead. The event is generated before
Director creates instances of any behavior scripts attached to the sprite when the
message is sent.
The object reference
behaviors and frame scripts.
If a sprite begins in the first frame that plays in the movie, the
the
prepareMovie
Note: Be aware that some sprite properties, such as the
in a beginSprite handler. This is because the property needs to be calculated, which is not done until
the sprite is drawn.
The
,
, and
go
play
Example
This handler plays the sound cast member Stevie Wonder when the sprite begins:
-- Lingo syntax
on beginSprite me
sound(1).play(member("Stevie Wonder"))
end
// JavaScript syntax
function beginSprite() {
sound(1).play(member("Stevie Wonder"));
}
See also
on
endSprite,
on
deactivateWindow, frontWindow,
is passed to this event if it is used in a behavior. The message is sent to
me
message but before the
commands are disabled in an
updateStage
on
prepareFrame,
scriptInstanceList
beginSprite
and
prepareFrame
startMovie
sprite property, may not be accessible
rect
on beginSprite
on
moveWindow,
open()
, this event is
endSprite
.
prepareFrame
beginSprite
message is sent after
messages.
handler.
on beginSprite
161
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