Lingo Dictionary > L-N > mouseH

 

mouseH

Syntax

the mouseH
mouseH()

Description

System property and function; indicates the horizontal position of the mouse pointer. The value of mouseH is the number of pixels the cursor is positioned from the left edge of the Stage.

The mouseH function is useful for moving sprites to the horizontal position of the mouse pointer and checking whether the pointer is within a region of the Stage. Using the mouseH and mouseV functions together, you can determine the cursor's exact location.

The Director player for Java doesn't update the mouseH function when Lingo is in a repeat loop.

This function can be tested but not set.

Example

This handler moves sprite 10 to the mouse pointer location and updates the Stage when the user clicks the mouse button:

on mouseDown
	sprite(10).locH = the mouseH
	sprite(10).locV = the mouseV
	updateStage
end

Example

This statement tests whether the cursor is more than 10 pixels to the right or left of a starting point and if it is, sets the variable Far to TRUE:

if abs(mouseH() - startH) > 10 then 
	draggedEnough = TRUE

See also

locH, locV, mouseV, mouseLoc