public static const ALL:String = "all"
Language version: | ActionScript 3.0 |
A single value that encompasses all phases of simple gestures like two-finger-tap or swipe.
For gestures that set the event object phase
property to all
(swipe and two-finger tap gestures),
the phase
value is always all
once the event is dispatched.
See also
public static const BEGIN:String = "begin"
Language version: | ActionScript 3.0 |
The beginning of a new gesture (such as touching a finger to a touch enabled screen).
See also
public static const END:String = "end"
Language version: | ActionScript 3.0 |
The completion of a gesture (such as lifting a finger off a touch enabled screen).
See also
public static const UPDATE:String = "update"
Language version: | ActionScript 3.0 |
The progress of a gesture (such as moving a finger across a touch enabled screen).
See also
The following example shows event handling for the
GESTURE_ROTATE
events.
While the user performs a rotation gesture on the touch-enabled device, mySprite rotates and myTextField populates with the current phase.
Multitouch.inputMode = MultitouchInputMode.GESTURE;
var mySprite = new Sprite();
mySprite.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate );
mySprite.graphics.beginFill(0x336699);
mySprite.graphics.drawRect(0, 0, 100, 80);
var myTextField = new TextField();
myTextField.y = 200;
addChild(mySprite);
addChild(myTextField);
function onRotate(evt:TransformGestureEvent):void {
evt.target.rotation -= 45;
if (evt.phase==GesturePhase.BEGIN) {
myTextField.text = "Begin";
}
if (evt.phase==GesturePhase.UPDATE) {
myTextField.text = "Update";
}
if (evt.phase==GesturePhase.END) {
myTextField.text = "End";
}
}