0

I have a little issue related to the events MOUSE_MOVE and TransformGestureEvent.GESTURE_ZOOM.

I want to distinguish both events, when I'm zooming an object MOUSE_MOVE should not act.

In the functions of both events, I start indicating event.stopPropagation(); but no success, so if I press with one finger and move, the MOUSE_MOVE Event should work, but when I press with two fingers, MOUSE_MOVE should not work.

Is there any way that when i could prevent MOUSE_MOVE Event act when I'm Zooming the object?

domoindal
  • 1,513
  • 2
  • 17
  • 33

1 Answers1

0

You could try event.stopImmediatePropagation(). I'm not sure what order the events you are describing fire in, though, so even this may not work. event.preventDefault() may also help.

Docs for it are here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/Event.html#stopImmediatePropagation%28%29

and here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/Event.html#preventDefault%28%29

You should be able to check the event.cancelable Boolean property to see if the default behaviour can be prevented or not.

Jude Fisher
  • 11,138
  • 7
  • 48
  • 91
  • I was afraid of that. One last thought: does it make a difference if you add the event listeners in a different order, with `TransformGestureEvent.GESTURE_ZOOM` added first, and including all of `stopPropagation()`, `stopImmediatePropagation()`, and `preventDefault()` in that first listener? (I'm asking rather than trying myself because I don't have a touchscreen available with which to test) If that doesn't work then you'll have to come up with another solution, such as delaying the mouse move for a few hundred milliseconds to see if a second finger touches down. – Jude Fisher Sep 16 '12 at 11:52
  • I will check it and comment you the results. – domoindal Sep 17 '12 at 14:48