Lingo Dictionary
87
Example
When used in the following handler, the
beginRecording
keyword begins a Score generation
session that animates the cast member Ball by assigning the cast member to sprite channel 20 and
then moving the sprite horizontally and vertically over a series of frames. The number of frames is
determined by the argument
numberOfFrames
.
on animBall numberOfFrames
beginRecording
horizontal = 0
vertical = 100
repeat with i = 1 to numberOfFrames
go to frame i
sprite(20).member = member "Ball"
sprite(20).locH = horizontal
sprite(20).locV = vertical
sprite(20).type = 1
sprite(20).foreColor = 255
horizontal = hori 3
vertical = ve 2
updateFrame
end repeat
endRecording
end
See also
endRecording
,
updateFrame
,
scriptNum
,
tweened
on beginSprite
Syntax
on beginSprite
statement(s)
end
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
endSprite
, this event is
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
prepareFrame
.
Director creates instances of any behavior scripts attached to the sprite when the
beginSprite
message is sent.
The object reference
me
is passed to this event if it is used in a behavior. The message is sent to
behaviors and frame scripts.
If a sprite begins in the first frame that plays in the movie, the
beginSprite
message is sent after
the
prepareMovie
message but before the
prepareFrame
and
startMovie
messages.
Note:
Be aware that some sprite properties, such as the
rect
sprite property, may not be accessible in a
beginSprite handler. This is because the property needs to be calculated, which is not done until the sprite is drawn.
The
go
,
play
, and
updateStage
commands are disabled in an
on beginSprite
handler.
Summary of Contents for DIRECTOR MX-LINGO DICTIONARY
Page 1: ...Lingo Dictionary Macromedia Director MX...
Page 756: ...Index 756...