User Guide
mouseItem 873
mouseItem
Usage
-- Lingo syntax
_mouse.mouseItem
// JavaScript syntax
_mouse.mouseItem;
Description
Mouse property; contains the number of the item under the pointer when the property is called
and the pointer is over a field sprite. Read-only.
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 loop. If a handler or loop relies
on the initial value of
mouseItem when the handler or loop begins, call this property once and
assign its value to a local variable.
Example
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:
-- Lingo syntax
if (mouse.mouseItem = -1) then
member("Instructions").text = "Please point to an item."
end if
// JavaScript syntax
if (_mouse.mouseItem == -1) {
member("Instructions").text = "Please point to an item.";
}
This statement assigns the item under the pointer in the specified field to the variable
currentItem:
-- Lingo syntax
currentItem = member(_mouse.mouseMember).item[_mouse.mouseItem]
// JavaScript syntax
var currentItem = member(_mouse.mouseMember).getProp("item",
_mouse.mouseItem);
See also
itemDelimiter, Mouse, mouseChar, mouseLine, mouseWord