Skip to main content
Inspiring
April 10, 2013
Question

2 TouchPoints [HELP]

  • April 10, 2013
  • 3 replies
  • 637 views

I've been struggling trying to get this to work... 

I have an iPad app where I have 2 doors.  DoorLeft_mc and DoorRight_mc

the doors are closed. 

I want it so that if you pull apart the doors they slide apart with your fingers ( dragging ).

I cant get it to work with touch points.  I have it working with MouseEvent's but this is no good as mouse events can only have 1 touchpoint at a time.

Does anyone have any ideas how to tackle this. ?

This topic has been closed for replies.

3 replies

April 10, 2013

Hey there.

Check out:

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

somedisplay.addEventListener(TouchEvent.TOUCH_BEGIN, handleTabBegin);

somedisplay.addEventListener(TouchEvent.TOUCH_MOVE, handleTabMove);

somedisplay.addEventListener(TouchEvent.TOUCH_END, handleTabEnd);

Every "finger" has a touchPointID, because multiple touches can occur simultaneously.

If you keep track of them (e.g. in an assoc-Array, push them in at _BEGIN, remove them at _END, process them at_MOVE) you can interpret your own gestures. Its not as complicate as it sounds in the docs.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TouchEvent.html#touchPointID

Mark.fromOP
Inspiring
April 12, 2013

Yep verdave got it right, you have to track the touchPointID it is basically a tracking number for each finger this way you can tell them apart when all sorts of excitment is happening.

April 12, 2013

Yep Mark.fromOP got it right, that i got it right...... ... .. .