Skip to main content
Inspiring
March 26, 2013
Answered

Determining a diagonal gesture with MultitouchInputMode.GESTURE ?

  • March 26, 2013
  • 1 reply
  • 587 views

How do I determine a diagonal gesture with MultitouchInputMode.GESTURE ?

This topic has been closed for replies.
Correct answer iBr3nt

Hi,

You calculate it based on the direction of both the offsetX and offsetY.

Let's say you're listening to the TransformGestureEvent.GESTURE_SWIPE. offsetX indictates left/right with -1 for left and 1 for right. offsetY indicates up/down with 1 for down and -1 for up. So if offsetX is 1 and offsetY is 1, you just went down to the right.

It all depends on what you're trying to detect. Check out the documentation for the TransformGestureEvent and see if one of those events give you the values you want.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TransformGestureEvent.html

If you need more detail than that, you'll have to roll your own "gesture" by switching to tracking touch events and calculating it that way.

iBrent

1 reply

iBr3nt
iBr3ntCorrect answer
Inspiring
March 27, 2013

Hi,

You calculate it based on the direction of both the offsetX and offsetY.

Let's say you're listening to the TransformGestureEvent.GESTURE_SWIPE. offsetX indictates left/right with -1 for left and 1 for right. offsetY indicates up/down with 1 for down and -1 for up. So if offsetX is 1 and offsetY is 1, you just went down to the right.

It all depends on what you're trying to detect. Check out the documentation for the TransformGestureEvent and see if one of those events give you the values you want.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TransformGestureEvent.html

If you need more detail than that, you'll have to roll your own "gesture" by switching to tracking touch events and calculating it that way.

iBrent