The introduction of touch-screens has made the process of moving between pages of information more natural. The iPhone made simple touch gestures, such as swiping, popular. For example, many photo viewer applications allow the user to quickly flick their finger across the screen in order to view the next image in a sequence.
The TransformGestureEvent.GESTURE_SWIPE
event
is available, allowing both vertical and horizontal swiping gestures to be detected and acted upon.
Let us see how this is done.
From Flash Professional, open chapter5\recipe6\recipe.fla
from the book's accompanying code bundle.
Sitting on the stage is a container movie clip named content
, which is over twice the width of the stage. Inside the container are two distinct bubbles, with only a single bubble able to fit on screen at any one time. We will write code to let the user swipe horizontally between the two bubbles.