Skip to main content
Known Participant
July 22, 2011
Question

Problem with Touch Events

  • July 22, 2011
  • 2 replies
  • 1504 views

I'm using Touch Events for my iPad app rather than gestures.

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

I have a large MC called tiles, which is essentially 4 screens long that drags from screen to screen (4x(1024x768)).

I have an MC called mainMenu within tiles, for example tiles.mainMenu

The problem is when I touch tiles.mainMenu with 2 fingers, it becomes draggable.

Does anyone know how I can disable the 2 fingers causing this MC to become draggable? Please note, this happens to any movieclip within tiles... not just mainMenu.

The problem used to happen when I touched tiles.mainMenu with 1 finger but I fixed it by removing the event listener from tiles when tiles.mainMenu was pressed. This was my solution in as3 below that fixed the problem with 1 finger touching the mainMenu... now I need to work out how to fix the problem with 2 fingers touching the mainMenu as I can't submit this app until I get this fixed... please help

tiles.mainMenu.addEventListener(MouseEvent.MOUSE_DOWN, mainMenuDown);

tiles.mainMenu.addEventListener(MouseEvent.MOUSE_UP, mainMenuUp);

function mainMenuDown(event:MouseEvent):void {

trace("Mouse Down triggered");

//remove the event listener so the buttons can't be dragged around the screen

tiles.removeEventListener(TouchEvent.TOUCH_BEGIN, homeTouchBegin);

tiles.removeEventListener(TouchEvent.TOUCH_END, homeTouchEnd);

}

function mainMenuUp(event:MouseEvent):void {

trace("Mouse Up triggered");

//remove the event listener so the buttons can't be dragged around the screen

tiles.addEventListener(TouchEvent.TOUCH_BEGIN, homeTouchBegin);

tiles.addEventListener(TouchEvent.TOUCH_END, homeTouchEnd);

}

This topic has been closed for replies.

2 replies

Pahup
Adobe Employee
Adobe Employee
August 10, 2011

Hey Mike,

Could you please try following in your listener. Use currentTarget instead of target.

event.currentTarget.startTouchDrag(event.touchPointID, false, homeDragBounds);

event.currentTarget.stopTouchDrag(event.touchPointID);

Thanks

-Pahup

Pahup
Adobe Employee
Adobe Employee
July 22, 2011

Could you please post a sample working source which demonstrates the problem.

-Pahup

Known Participant
July 22, 2011

Hi Pahup, do you mean the FLA when you say a sample working source?

Can I attach files?

Pahup
Adobe Employee
Adobe Employee
July 22, 2011

You can send it to pahup      at        adobe      dot       com

-Pahup