I’m trying to do that when the user touch (not click with mouse the program runs on android)
the code gets the (position of) touch x and y (like _xmouse but it dosen’t work on android)
How can I do it?
Thank’s!
I’m trying to do that when the user touch (not click with mouse the
Share
You have to set up an event listener function for a TouchEvent, and in the event you get as a parameter you can use the following properties:
stageX: The horizontal coordinate at which the event occurred in global stage coordinates.
stageY: The vertical coordinate at which the event occurred in global stage coordinates.
localX: The horizontal coordinate at which the event occurred relative to the containing sprite.
localY: The vertical coordinate at which the event occurred relative to the containing sprite.
for example:
For more info, take a look at the Adobe reference for TouchEvent here.