User Guide
Chapter 3136
Dot syntax:
on beginSprite me
if sprite(the spriteNum of me).directToStage = FALSE then
sprite(the spriteNum of me).clickMode = #opaque
else
sprite(the spriteNum of me).clickMode = #boundingBox
end if
end
Verbose syntax:
on beginSprite me
if the directToStage of sprite the spriteNum of me = FALSE then
set the clickMode of sprite the spriteNum of me = #opaque
else
set the clickMode of sprite the spriteNum of me = #boundingBox
end if
end
clickOn
Syntax
the clickOn
Description
Function; returns the last active sprite clicked by the user. An active sprite is a sprite that has a
sprite or cast member script associated with it.
When the user clicks the Stage,
clickOn returns 0. To detect whether the user clicks a sprite with
no script, you must assign a placeholder script to it (
“--," for example) so that it can be detected
by the clickOn function.
The
clickOn can be checked within a repeat loop. However, neither clickOn nor clickLoc
functions change value when the handler is running. The value that you obtain is the value from
before the handler started.
Examples
This statement checks whether sprite 7 was the last active sprite clicked:
if the clickOn = 7 then alert "Sorry, try again."
This statement sets the foreColor property of the last active sprite that was clicked to a
random color:
sprite(the clickOn).foreColor = random(255)-1
See also
doubleClick, the mouseDown (system property), mouseMember, the mouseUp (system
property)