880
Chapter 14: Properties
Description
Mouse property; indicates the vertical position of the mouse cursor, in pixels, from the top of the
Stage. Read-only.
The value of this property increases as the cursor moves down and decreases as the cursor
moves up.
The
mouseV
property is useful for moving sprites to the vertical position of the mouse cursor and
checking whether the cursor is within a region of the Stage. Using the
mouseH
and
mouseV
properties together, you can identify the cursor’s exact location.
Example
This handler moves sprite 1 to the mouse pointer location and updates the Stage when the user
clicks the mouse button:
-- Lingo syntax
on mouseDown
sprite(1).locH = _mouse.mouseH
sprite(1).locV = _mouse.mouseV
end
// JavaScript syntax
function mouseDown() {
sprite(1).locH = _mouse.mouseH;
sprite(1).locV = _mouse.mouseV;
}
This statement tests whether the pointer is more than 10 pixels above or below a starting point
and, if it is, sets the variable
vFar
to
TRUE
:
-- Lingo syntax
startV = 7
if (abs(_mouse.mouseV - startV) > 10) then
vFar = TRUE
end if
// JavaScript syntax
var startV = 7
if (Math.abs(_mouse.mouseV - startV) > 10) {
var vFar = true;
}
See also
locH
,
locV
,
Mouse
,
mouseH
,
mouseLoc
mouseWord
Usage
-- Lingo syntax
_mouse.mouseWord
// JavaScript syntax
_mouse.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...