403
If used in a behavior, this event is passed the sprite script or frame script reference
me
.
Example
This statement displays the mouse location when the mouse pointer is over a sprite:
on mouseWithin
member("Display").text = string(the mouseH)
end mouseWithin
See also
on mouseEnter
,
on mouseLeave
mouseWord
Syntax
the mouseWord
Description
System property; contains the number of the word under the pointer when the property is called
and when the pointer is over a field sprite. Counting starts from the beginning of the field. When
the mouse is not over a field, the result is -1.
The value of the
mouseWord
property can change in a handler or repeat loop. If a handler or
repeat loop uses this property multiple times, it’s usually a good idea to call the function once and
assign its value to a local variable.
Examples
This statement determines whether the pointer is over a field sprite and changes the content of
the field cast member Instructions to “Please point to a word.” when it is not:
if the mouseWord = -1 then
member("Instructions").text = "Please point to a word."
else
member("Instructions").text = "Thank you."
end if
This statement assigns the number of the word under the pointer in the specified field to the
variable
currentWord
:
currentWord = member(the mouseMember).word[the mouseWord]
This handler highlights the word under the pointer when the mouse button is pressed:
on mouseDown
thisField = sprite(the clickOn).member
if the mouseWord < 1 then exit
lastWord = 0
repeat while the stillDown
MW = the mouseWord
if MW < 1 then next repeat
if MW <> lastWord then
thisField.word[MW].hilite()
lastWord = MW
end if
end repeat
end
See also
mouseChar
,
mouseItem
,
mouseLine
,
number (words)
,
word...of
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...