395
mouseItem
Syntax
the mouseItem
Description
System property; contains the number of the item under the pointer when the function is called
and the pointer is over a field sprite. (An item is any sequence of characters delimited by the
current delimiter as set by
the itemDelimiter
property.) Counting starts at the beginning of the
field. If the mouse pointer is not over a field, the result is -1.
The value of the
mouseItem
property can change in a handler or repeat loop. If a handler or
repeat loop relies on the initial value of
mouseItem
when the handler or repeat loop begins, call
the property 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 an item.” when it is not:
if the mouseItem = -1 then
member("Instructions") = "Please point to an item."
end if
This statement assigns the item under the pointer in the specified field to the variable
currentItem
:
currentItem = member(mouseMember).item(mouseItem)
This handler highlights the item under the pointer when the mouse button is pressed:
on mouseDown
thisField = sprite(the clickOn).member
if the mouseItem < 1 then exit
lastItem = 0
repeat while the stillDown
MI = the mouseItem
if MI < 1 then next repeat
if MI <> lastItem then
thisField.item[MI].hilite()
lastItem = MI
end if
end repeat
end
See also
item...of
,
mouseChar
,
mouseLine
,
mouseWord
,
number (items)
,
itemDelimiter
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...