Chapter 23. Multitouch and Accelerometer Input

FEATURED CLASSES

  • flash.ui.Multitouch

  • flash.events.TouchEvent

  • flash.events.GestureEvent

  • flash.sensors.Accelerometer

  • flash.events.AccelerometerEvent

Due to the efforts of the Open Screen Project (http://openscreenproject.org), Flash Player is appearing on a growing number of smartphones. Simultaneously, consumers, desktop and laptop manufacturers, and makers of desktop operating systems are embracing touchscreens. The net effect is that Flash Player has access to a wider array of input than ever before. The user is no longer limited to a keyboard and mouse. In fact, she may not even have a keyboard or mouse installed, although chances are in that case that a software keyboard is provided and touch input can be interpreted as mouse input.

In this chapter you'll learn how to deal with not just touch-based input, but information from various sensors Flash Player may have access to, including accelerometers, and geolocation sensors such as GPS. I'll mention it, but I won't go into depth on geolocation because it's currently available only to AIR or native apps. Between the keyboard and mouse (Chapter 21, "Interactivity with the Mouse and Keyboard"), the camera and microphone (Chapter 33, "Capturing Sound and Video"), and touch and accelerometer (this chapter), modern hardware has a surprisingly extensive repertoire of interaction modes.

Planning for Your Audience

Consider three platforms you can find Flash Player on: a phone with a 320 × 480 pixel ...

Get ActionScript 3.0 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.