Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Mixing two input modes

New Here ,
Mar 07, 2012 Mar 07, 2012

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?

TOPICS
Development
757
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2012 Mar 07, 2012

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 07, 2012 Mar 07, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2012 May 25, 2012
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2012 Mar 07, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines