1 / 18

Getting Touch Events to Play Nice in Flex

Getting Touch Events to Play Nice in Flex. Ryan Frishberg Software Consultant, Lab49 http://www.frishy.com. About Me…About You. Former Flex SDK Engineer Currently consultant at Lab49 UK. Flash Touch Basics. f lash.ui.MultitouchInputMode TOUCH_POINT GESTURE NONE. Flash Touch Basics.

hall
Download Presentation

Getting Touch Events to Play Nice in Flex

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GettingTouchEvents to Play Nice in Flex Ryan Frishberg Software Consultant, Lab49 http://www.frishy.com

  2. About Me…About You • Former Flex SDK Engineer • Currently consultant at Lab49 UK

  3. Flash Touch Basics • flash.ui.MultitouchInputMode • TOUCH_POINT • GESTURE • NONE

  4. Flash TouchBasics • flash.events.TouchEvent • BEGIN • END • MOVE • touchEvent • touchPointID • isPrimaryTouchPoint • pressure • sizeX • sizeY

  5. Flash TouchBasics • flash.events.GestureEvent • GESTURE_TWO_FINGER_TAP • flash.events.GestureTransformEvent • GESTURE_PAN • GESTURE_ROTATE • GESTURE_ZOOM • GESTURE_SWIPE • flash.events.PressAndTapGestureEvent • PRESS_AND_TAP_GESTURE_EVENT

  6. Flex TouchBasics • MultiTouch.inputModecontrolswhat Flash eventsyouget • UIComponent.interactionMode style controls how the Flex components respond to thoseevents • mx.core.InteractionMode • TOUCH • MOUSE • New down state for item renderers • Down vs selected: Down shows intent to click, selected shows item selection(s). To show both in mobile, use an item rendererwith a checkmark

  7. Multi-select Item RenderersExample

  8. WhyisTouchDifficult • Toucheventscanbeinaccurate • Interactions are asynchronous and ambiguous • Whointerpretswhatwasmeant? • Components need to coordinatetogether

  9. Buttonclicks in a touch-world • User presses down on a button • Are theyattempting to touch the button or start scrolling? • When do we show a down state on the Button? • What if the user starts scrolling later? • What if the user presses on the buttonquickly – how does the user receiveany feedback?

  10. Touch-cancellationBehaviors • MouseEvents are bubbled up. • Whena component seesa mouse event or series of mouse eventstheywant to interpret, the component shoulddispatchTouchInteractionEvents • ThreeTouchInteractionEvents: • STARTING, START, END

  11. Buttons inside item renderers • Not just a touch issue! Issues occurwith mouse as well • event.preventDefault() isyourfriend

  12. AddingSwipeGesture • Listen for GestureEvent • Listenfor otherTouchInteractionSTARTs and ENDs – can’tinterruptanotherSTART • Once swipeoccurs, dispatch a STARTING, and if not cancelled, dispatch a START (and then an END sinceit’s not asynchronous

  13. Questions

More Related