391
This handler highlights the character under the pointer when the sprite contains a text
cast member:
property spriteNum
on mouseWithin me
if sprite(spriteNum).member.type = #field then
MC = the mousechar
if MC < 1 then exit -- if over a border, final line, etc.
hilite char MC of field sprite(spriteNum).member
else alert "Sorry, ’hilite’ and ’mouseChar’ are for fields."
end
See also
mouseItem
,
mouseLine
,
mouseWord
,
char...of
,
number (characters)
on mouseDown (event handler)
Syntax
on mouseDown
statement(s)
end
Description
System message and event handler; contains statements that run when the mouse button is pressed.
When the mouse button is pressed, Lingo searches the following locations, in order, for an
on
mouseDown
handler: primary event handler, sprite script, cast member script, frame script, and
movie script. Lingo stops searching when it reaches the first location that has an
on mouseDown
handler, unless the handler includes the
pass
command to explicitly pass the
mouseDown
message
on to the next location.
To have the same response throughout the movie when pressing the mouse button, set
mouseDownScript
or put a mouseDown handler in a Movie script.
The
on mouseDown
event handler is a good place to put Lingo that flashes images, triggers sound
effects, or makes sprites move when the user presses the mouse button.
Where you place an
on mouseDown
handler can affect when it runs.
•
To apply the handler to a specific sprite, put it in a sprite script.
•
To apply the handler to a cast member in general, put it in a cast member script.
•
To apply the handler to an entire frame, put it in a frame script.
•
To apply the handler throughout the entire movie, put it in a movie script.
You can override an
on mouseDown
handler by placing an alternative
on mouseDown
handler in a
location that Lingo checks before it gets to the handler you want to override. For example, you
can override an
on mouseDown
handler assigned to a cast member by placing an
on mouseDown
handler in a sprite script.
If used in a behavior, this event is passed the sprite script or frame script reference
me
.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...