Skip to main content
LilGames
Inspiring
January 5, 2014
Question

How do you support both gestures and simple clicks in iOS?

  • January 5, 2014
  • 2 replies
  • 970 views

I am having some real difficulties getting any sort of consistent input behaviour when I try to mix Gestures and just tapping a button. (Using Flash Develop, Flash Professional CC and AIR 3.9 v.1030 )

I have a movie clip in upper half of screen that has an event listener for the SWIPE gesture. Then I have buttons in bottom of screen listening for Mouse CLICK, Touch TAP, and I tried a couple others like Gesture PRESS and TAP.

First, none of the touch events would ever register. I get mouse click to work, but then if I swipe a few times, the mouse clicking no longer works!

The code is not complicated:

Multitouch.inputMode = MultitouchInputMode.GESTURE;

mc_testButton.addEventListener(MouseEvent.MOUSE_DOWN, test_mouse);

mc_prizeScroller.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);

private function test_mouse(e:MouseEvent = null):void

        {

            trace("\rMouse");

            log("mouse event");

        }

function onSwipe (e:TransformGestureEvent):void

        {

            trace("\rSwipe!");

            log("SWIPE");

            log(".target:" + e.target);

            log(".currentTarget:" + e.currentTarget);

            log(" ");           

        }

Why would swiping then turn off mouse click? Why doesnt TOUCH_TAP ever work???  I've looked all over the web for examples and frankly, I am confused by the variety of input types supported by AIR and which to use. This is complicated by te fact that the touch simulator works for Swipe but not for press/tap.

Is there a good code example somewhere that mixed SWIPE and simple button tapping?

This topic has been closed for replies.

2 replies

LilGames
LilGamesAuthor
Inspiring
January 5, 2014

Close or delete this thread. Mouse events still work. It was my message logging that stopped.

LilGames
LilGamesAuthor
Inspiring
January 5, 2014

I just read this, at this page:

"Swipe: Move three fingers left-to-right or right-to-left, top-to-bottom, or bottom-to-top, quickly."

http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa930-581fb7b1257b16ff45-8000.html

Is this accurate? When I test, I am able to trigger TransformGestureEvent.GESTURE_SWIPE with only ONE finger (on iPhone 4).