Skip to main content
July 19, 2011
Answered

Touch equivalent of mouseX?

  • July 19, 2011
  • 1 reply
  • 1117 views

Is there something like tapX or touchX I tried all combinations I could think of the top of my head and did some searching but nothing comes up.

Any ideas?

This topic has been closed for replies.
Correct answer boat5

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchBegin);

function touchBegin(e:TouchEvent):void {
    ball.x = e.stageX;
    ball.y = e.stageY;

    //or depending on the situation
    //ball.x=e.localX;
    //ball.y=e.localY;
}

1 reply

boat5Correct answer
Inspiring
July 20, 2011

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchBegin);

function touchBegin(e:TouchEvent):void {
    ball.x = e.stageX;
    ball.y = e.stageY;

    //or depending on the situation
    //ball.x=e.localX;
    //ball.y=e.localY;
}

July 20, 2011

Awesome, havent tried it yet but I am sure it will be just what I need.

Thank you so much!!!