Skip to main content
Inspiring
February 9, 2013
Question

Touch Coordinates without e.stageX and e.stageY

  • February 9, 2013
  • 1 reply
  • 1922 views

So I have a virtual camera, and eventually I get off the stage.  I used to use e.stageX and e.stageY to get the coordinates of the touch, but I cannot do that anymore because I am no longer on the stage.  How do I get the coordinates of the user's touch when they are not touching the stage?  Surely there is a way, because if there wasn't, I'd have to come up with some extremely - difficult equasion, right?  But I want the simple way, or at least adobe can make a keyword for it, because I cannot rely on the stage for everything.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 9, 2013

there are also e.localX and e.localY among other properties.

Gh-AfgAuthor
Inspiring
February 9, 2013

I can't seem to understand the use of e.localX and e.localY.  Can you explain?

kglad
Community Expert
Community Expert
February 10, 2013

those are the coordinates local to the event dispatching object.

so, if you had a movieclip at 400,500 and you clicked on the registration point of that movieclip:

e.stageX = 400+the movieclip's registration point's x

e.stageY = 500+the movieclip's registartion point's y

e.localX = 0;

e.localY = 0;