User Guide
mouseLine 875
mouseLine
Usage
-- Lingo syntax
_mouse.mouseLine
// JavaScript syntax
_mouse.mouseLine;
Description
Mouse property; contains the number of the line under the pointer when the property is called
and the pointer is over a field sprite. Read-only.
Counting starts at the beginning of the field; a line is defined by Return delimiter, not by the
wrapping at the edge of the field. When the mouse pointer is not over a field sprite, the result
is -1.
The value of the
mouseLine property can change in a handler or loop. If a handler or loop uses
this property multiple times, it’s usually a good idea to call the 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 a line.” when it is not:
-- Lingo syntax
if (_mouse.mouseLine = -1) then
member("Instructions").text = "Please point to a line."
end if
// JavaScript syntax
if (_mouse.mouseLine == -1) {
member("Instructions").text = "Please point to a line.";
}
This statement assigns the contents of the line under the pointer in the specified field to the
variable
currentLine:
-- Lingo syntax
currentLine = member(_mouse.mouseMember).line[_mouse.mouseLine]
// JavaScript syntax
var currentLine = member(_mouse.mouseMember).getProp("line",
_mouse.mouseLine);
See also
Mouse, mouseChar, mouseItem, mouseWord