see my mx , my[img]http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1978.0;attach=3507;image[/img]
mx =mouse coordinate in x
my =mouse coordinate in y

u can download it  [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1027.0]http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1027.0[/url]

how mx, and my is used to detect the mouse position.

there are also many other applets from Professor Fu Kwun Hwang that has mx and my :)
it is one which i adapted from him.