Copy link to clipboard
Copied
I wonder if there is a way to mix Touch Point input mode with Gesture input mode
I have a sprite that serves as a container and works in touch point input mode. This sprite responds to touch start/move/end - that way I have top-down moveable menu container.
Inside this sprite I have several other sprites (menu buttons) and I'd like them to respond to swipe gestures (left/right).
And here's where I got stuck. When I switch to gesture mode, buttons react to swipe, but container doesn't move. The other way round, container moves, but buttons are useless.
Anyone got an idea how so solve this?
Copy link to clipboard
Copied
You either have to convert the touch point inputs to MouseEvents and use the Gesture mode, or keep the TouchPoint mode and write custom gesture code.
Chris Griffith
Copy link to clipboard
Copied
Do you have to convert touch points? Can't you just use a mouse listener, and let Flash worry about the fact that it came from a touch?
However it's done, how will you tell the difference between someone trying to move the container across the screen quickly, and someone trying to flick one of the items in the container?
Copy link to clipboard
Copied
Colin Holgate wrote:
...
However it's done, how will you tell the difference between someone trying to move the container across the screen quickly, and someone trying to flick one of the items in the container?
I too am stuck with the Touch / Gesture combo, but I am using getObjectsUnderPoint() to tell the difference between an object interaction (eg gallery flick), and a larger container interaction (eg page change.)
I just ensure I give any small object that requires interaction a constant .name propery. If that name appears in the getObjectsUnderPoint() stack, I block general interaction, and allow local interaction.
Copy link to clipboard
Copied
That's what I was afraid of.
I like the way startTouchDrag combined with TweenMax creates smooth scrolling and I like built in swipe handler. That's too bad you can't combine both.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now