# How to get coordinates of two touch points simultaneously? AS3 AIR

**URL:** <https://forum.kirupa.com/t/how-to-get-coordinates-of-two-touch-points-simultaneously-as3-air/637694>\
**Category:** flash\
**Created:** [January 3, 2018, 9:00am UTC](https://forum.kirupa.com/t/how-to-get-coordinates-of-two-touch-points-simultaneously-as3-air/637694 "2018-01-03T09:00:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekoneo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ekoneo/32/8893_2.png) [@ekoneo](https://forum.kirupa.com/u/ekoneo)\
**Post date:** [January 3, 2018, 9:00am UTC](https://forum.kirupa.com/t/how-to-get-coordinates-of-two-touch-points-simultaneously-as3-air/637694/1 "2018-01-03T09:00:59Z")

</div>

Dear All,

After my researches, I prepare a simple .fla. I try to write two touch points coordinates simultaneously. To separate 1th and 2th touches, I used TouchID odd even condition simultaneously. But I couldnt achieve that. My example is on attachment. And I wrote the script below. Is anybody knows an idea? Thanks.

[Question1.fla](https://forum.kirupa.com/uploads/short-url/hE2ys8x0LB2Qa4BP8zlxvzlH1r6.fla) (5.2 KB)

```
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

var curTouchPoints:Dictionary = new Dictionary();

stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchStart);

stage.addEventListener(TouchEvent.TOUCH_MOVE, touchMove);

function touchStart(e:TouchEvent):void
{
	curTouchPoints[e.touchPointID] = {obj:e.currentTarget,offsetX:e.localX,offsetY:e.localY};
	e.currentTarget.addEventListener(TouchEvent.TOUCH_END,touchEnd);
}

function touchMove(e:TouchEvent):void
{
	if (e.touchPointID % 2 == 0)
	{
		TouchX1.text = "" + e.stageX;
		TouchY1.text = "" + e.stageY;
	}
	else if (e.touchPointID % 2 != 0)
	{
		TouchX2.text = "" + e.stageX;
		TouchY2.text = "" + e.stageY;
	}
}

function touchEnd(e:TouchEvent):void
{
	delete curTouchPoints[e.touchPointID];
	e.currentTarget.removeEventListener(TouchEvent.TOUCH_END,touchEnd);
}

```

---

<div class="post-metadata">

**Author:** ![ekoneo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ekoneo/32/8893_2.png) [@ekoneo](https://forum.kirupa.com/u/ekoneo)\
**Post date:** [January 3, 2018, 11:49am UTC](https://forum.kirupa.com/t/how-to-get-coordinates-of-two-touch-points-simultaneously-as3-air/637694/2 "2018-01-03T11:49:04Z")

</div>

There is no problem. Because the problem is text fields needs embeding numerals and punctiations. After adding embed operation text fields works correctly.

Thanks.
