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
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...