Skip to main content
Known Participant
July 5, 2009
Answered

How to show mouse x and y position of stage in trace

  • July 5, 2009
  • 1 reply
  • 541 views

I am in learning phase but do not to show the x andy posion of mouse on the stage. I want to trace the x and y position of mouse in stage. How we can do this ?

This topic has been closed for replies.
Correct answer kglad

stage.addEventListener(MouseEvent.MOUSE_MOVE,f);

function f(e:MouseEvent){
trace(e.localX,e.localY);
}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 5, 2009

stage.addEventListener(MouseEvent.MOUSE_MOVE,f);

function f(e:MouseEvent){
trace(e.localX,e.localY);
}

nepaliktoAuthor
Known Participant
July 5, 2009

Superb answer and help. Thanks u very much

kglad
Community Expert
Community Expert
July 5, 2009

you're welcome.