
15
Some sprite events
Some sprite events
•
•
mouseEnter
mouseEnter
,
,
mouseLeave
mouseLeave
–
–
Called when cursor
Called when cursor
enters or leaves the sprite, respectively.
enters or leaves the sprite, respectively.
•
•
mouseDown
mouseDown
,
,
mouseUp
mouseUp
–
–
Called when user
Called when user
presses or releases the left mouse button over the
presses or releases the left mouse button over the
sprite, respectively.
sprite, respectively.
•
•
beginSprite
beginSprite
–
–
Called when sprite is created
Called when sprite is created
•
•
prepareFrame
prepareFrame
,
,
exitFrame
exitFrame
–
–
Called before the
Called before the
current frame is drawn and when current frame
current frame is drawn and when current frame
has been drawn, respectively.
has been drawn, respectively.
Sending messages to a sprite
Sending messages to a sprite
spriteNumber = ...
sendSprite(spriteNumber, #myHandler, 5)
...
on myHandler me, number
put “The number is “&&number
end
Here, the number 5 is sent as a parameter to the handler.
The handler is a custom handler that prints the number to
the Director message window.
Comentários a estes Manuais