Using Director > Navigation and User Interaction > Finding mouse pointer locations with Lingo

 

Finding mouse pointer locations with Lingo

Determining where the mouse pointer is on the Stage is a common need in Director.

To determine the mouse pointer's horizontal and vertical positions, use the mouseH() and mouseV() functions. See mouseH and mouseV.

The mouseV() function returns the distance, in pixels, between the mouse pointer and the upper left corner of the Stage. The mouseH() function returns the distance, in pixels, between the mouse pointer and the upper left corner of the Stage.

The statements put the mouseH and put the mouseV display the mouse pointer's location in the Message window.

For example, this handler directs the Message window to display the distance (in pixels) between the pointer and the upper left corner of the Stage:

on exitFrame
	put the mouseH
	put the mouseV
	go to the frame
end