From d33c6764b60a632a1f8ce0b71db7fe1fec8b249d Mon Sep 17 00:00:00 2001 From: Pavel fljot Date: Fri, 17 Aug 2012 19:01:34 +0300 Subject: [PATCH] Update README for recent changes in API --- README.textile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.textile b/README.textile index 70152a2..42e5944 100644 --- a/README.textile +++ b/README.textile @@ -41,10 +41,26 @@ And I hope people to become giving some real feedback at least. h3. Getting Started -Like so: +All gestures dispatch (if you listen) GestureEvent with the next types: +GestureEvent.GESTURE_STATE_CHANGE +GestureEvent.GESTURE_IDLE +GestureEvent.GESTURE_POSSIBLE +GestureEvent.GESTURE_FAILED + +Discrete gestures also dispatch: +GestureEvent.GESTURE_RECOGNIZED + +Continuous gestures also dispatch: +GestureEvent.GESTURE_BEGAN +GestureEvent.GESTURE_CHANGED +GestureEvent.GESTURE_ENDED + +If you use a good IDE (such as Intellij IDEA, FDT, FlashDevelop, Flash Builder) you should see these events in autocompletion. + +Quick start:
var doubleTap:TapGesture = new TapGesture(myButton);
 doubleTap.numTapsRequired = 2;
-doubleTap.addEventListener(TapGestureEvent.GESTURE_TAP, onDoubleTap);
+doubleTap.addEventListener(GestureEvent.GESTURE_RECOGNIZED, onDoubleTap);
 ...
 private function onDoubleTap(event:TapGestureEvent):void
 {
@@ -53,7 +69,8 @@ private function onDoubleTap(event:TapGestureEvent):void
 
or
var freeTransform:TransformGesture = new TransformGesture(myImage);
-freeTransform.addEventListener(TransformGestureEvent.GESTURE_TRANSFORM, onFreeTransform);
+freeTransform.addEventListener(GestureEvent.GESTURE_BEGAN, onFreeTransform);
+freeTransform.addEventListener(GestureEvent.GESTURE_CHANGED, onFreeTransform);
 ...
 private function onFreeTransform(event:TransformGestureEvent):void
 {