GithubHelp home page GithubHelp logo

fljot / gestouch Goto Github PK

View Code? Open in Web Editor NEW
355.0 355.0 85.0 733 KB

Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.

License: MIT License

ActionScript 100.00%

gestouch's People

Contributors

fljot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gestouch's Issues

TapGesture not always recognized

I'm currently developing a mobile app using FlashDevelop (project type is "AIR Mobile AS3 App"). The problem I'm having is that TapGestures (and others) are not always recognized across compilations. Sometimes it's almost impossible to have taps recognized, but with next compilation everything may work fine. My guess is some kind of race condition that occurs with the specific project type.

I'm not sure if this problem is related to Gestouch or the environment.

Starling.simulateMultitouch and Gestouch

First of all, thank you very much for this framework. I love it!

I am sorry if you have addressed this before, but I have not been able to find the solution or explanation. I am using Gestouch on a Starling project. I am trying to use the simulateMultitouch option to be able to test the app on the AIR simulator, but it does not seem to be working. Is this a known issue or am I doing something wrong? Any help is greatly appreciated.

Thanks again!

-ACC

[Question]How to get touchId used by swipe gesture?

I'm making an Air app and decided to try Gestouch to implement my character's jump input, which is a swipe movement in the up direction.
I also have a function that uses flash TouchEvent which is used to move my character right/left based on which half of the screen you touched.
The problem that I'm having is that when I try to jump, my character also moves, is there anyway I can get the touchId of my SwipeGesture's touch, so I can ignore this touch inside my character's movement function?

Thanks

Pure Flash Example

Hi,
Your works are really well done. What i asked for is that are there any flash version of example project. I think there ara many people do not use Flex. There many users who uses Air For Android or Air for iOS. Can you provide a Flash/as3 version of example project.
Thanks.

Pan and Swipe Release

Hi fljot,

Thanks to your help in Issue 18, we have both Pan and Swipe gestures recognized now! However, we still can't accomplish something we see commonly among (ie.) photo viewer applications on Android and iOS:

  1. PAN to slide an object back and forth as fast as the user moves their touch (working)
  2. Allow for a SWIPE gesture anytime during the PAN gesture (partially working)
  3. The SWIPE gesture can only occur if the user releases their touch from the device, otherwise the PAN continues to occur (not working)

Since the GesTouch SWIPE doesn't consider touch points, is their a way to accomplish using native GesTouch gestures or will we have to perform our own swipe recognition within the PAN CHANGED event? (For example, checking for a minimum velocity and listening for a TOUCH END event).

Thank you very much!

Compiling from flash professional

Hello, I linked your swc and am trying to do a very simple swipe example and am not able to pick up the recognized event. I do not get error when I compile and my code looks like this:

import org.gestouch.gestures.SwipeGesture;
import org.gestouch.events.GestureEvent;
import flash.text.TextField;

var swiper:SwipeGesture = new SwipeGesture(swipe);

var tf:TextField = new TextField();
tf.width = 500;
tf.height = 100;
tf.text = 'something';
addChild(tf);

swiper.addEventListener(org.gestouch.events.GestureEvent.GESTURE_RECOGNIZED, onGesture);

function onGesture(event:org.gestouch.events.GestureEvent):void{

var ges:SwipeGesture = event.target as SwipeGesture;
tf.text = new String(ges.offsetX+' '+ges.offsetY);

}

DO I need to set any type of input mode?

thank you.

Problem panning on iPad 4

Hi, I am having a problem with panning on the iPad 4. When I drag an object it does not stay centered on my finger and it strays quite noticeably. For instance, if an object is at the top of the screen, I click it and drag going downward, by the time I get a little more than 1/2 way down the screen with my finger, the object I am dragging is at the bottom of the screen. Everything work fine on the desktop when I test with a mouse and on an android tablet I have. It seems to only be present on the iPad 4. Could it have something to do with the retina display or something with my code? Thanks for any help.

Here is a simple test example:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" title="TestDrag" creationComplete="init()">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import org.gestouch.events.GestureEvent;
            import org.gestouch.gestures.TransformGesture;

            protected function init():void{
                var transformGesture:TransformGesture = new TransformGesture(box);
                transformGesture.addEventListener(org.gestouch.events.GestureEvent.GESTURE_BEGAN, onRectGesture);
                transformGesture.addEventListener(org.gestouch.events.GestureEvent.GESTURE_CHANGED, onRectGesture);
            }

            private function onRectGesture(event:org.gestouch.events.GestureEvent):void
            {
                const gesture:TransformGesture = event.target as TransformGesture;
                var gestureTarget:Button = gesture.target as Button;
                var matrix:Matrix = gestureTarget.transform.matrix;

                // Panning
                matrix.translate(gesture.offsetX, gesture.offsetY);
                gestureTarget.transform.matrix = matrix;
            }
        ]]>
    </fx:Script>
    <s:Button id="box" label="DRAG ME" width = "150" height = "150" />

</s:View>

SimulatorInputAdapter

Hi,

I am in need of creating SimulatorInputAdapter for multi-finger gestures with numTouchesRequired > 2.

First my idea was to create a InputAdapter based on keyboard input, but it seems that simulator does not support capturing hardware keyboard input unless there is an focused text input or similar.

What would be your recommendation for creating such an adapter?

Thanks for this great framework ๐Ÿ‘

Mateo Kozomara

TapGesture event location

I both the alpha 0.3.1 and 0.4 the im having problems receiving the X/Y coordinate of the tap. The other gestures works fine :)

TapGestureEvent.stageX / Y always returns NaN.
TapGestureEvent.localX / Y always returns NaN.

gestures sometimes don't happen

I am finding that about half of the time gestures don't trigger. I want to show a simple test case, but my test code doesn't generate any gestures at all. Before I describe how to reproduce the real issue, can you see why this timeline code would not show any gesture events? 'mc' is a movieclip that covers the whole stage:

import org.gestouch.gestures.TransformGesture;
import org.gestouch.gestures.SwipeGesture;
import org.gestouch.events.GestureEvent;
import org.gestouch.core.Gestouch;
import org.gestouch.core.GesturesManager;
import flash.utils.getTimer;

var freeTransform:TransformGesture = new TransformGesture(mc);
freeTransform.addEventListener("began",onFreeTransformBegan);

function onFreeTransformBegan(event:GestureEvent):void {
trace("began",getTimer(),Gestouch.touchesManager.activeTouchesCount);
}

The 'trace' never happens.

Swipe Offsets

Using both ORTHOGONAL and NO_DIRECTION for a SwipeGesture, we're seeing a lot of results where the magnitude of the X and Y offsets are the same (2 and -2, for example). This creates a 50/50 chance that the gesture is interpreted in the wrong direction than the user intended. We're being intentionally sloppy with our touches to see how well the framework can stand up to a fast paced grid game like Bejeweled.

Is there any way for us to tweak the Swipe instance to help avoid these scenarios? Can the offsets be decimal, for example? We tried playing with the slop parameter (pixels, I assume?), but that didn't appear to have any affect on our touch tests.

Thanks, fljot!

stage listener

I'm trying to integrate this with Nape + Starling, but I can't find a way to listen to the stage events, so I could get the obj list under the touch, any idea on how to do it?

cancel PanGesture when ZoomGeture begins...

Hi,
at first i wanted to express here my gratitude for this great framework, it's really a fantastic framework!

But i'm having some troubles to cancel an actual PanGesture when the user starts a zoom gesture.

So i have this here:

zoomGesture = new ZoomGesture( obj );
zoomGesture.addEventListener(GestureEvent.GESTURE_CHANGED, onZoom);

panGesture = new PanGesture( obj );
panGesture.addEventListener(GestureEvent.GESTURE_CHANGED, onPanGesture);

private function onZoom(event : GestureEvent) : void
{
    // possible active panGesture should be cancelled here
}

private function onPanGesture(event : GestureEvent) : void
{
    // some pan code...
}

I tried to use panGesture.requireGestureToFail(zoomGesture); without success and i also tried to override canBePreventedByGesture and canPreventGesture, but nothing worked for me.

Has somebody any ideia how to accomplish this?

Thank you very much,

Solano

Trouble Changing Input Modes

Is this the correct way to change input mode from mouse to touch?

GesturesManager.initDefaultInputAdapter = false;
GesturesManager.getInstance().addInputAdapter(new TouchInputAdapter(this.stage));

how to process the ConflictGestures in 0.4.6?

I try the following code to process the ConflictGestures in 0.4.6, but can not get zoom gesture function to call! it is good in 0.4.4 use delegate property.

function gestureShouldReceiveTouch(gesture:Gesture, touch:Touch):Boolean
{
return true;
}

function gestureShouldBegin(gesture:Gesture):Boolean
{
return true;
}

function gesturesShouldRecognizeSimultaneously(gesture:Gesture, otherGesture:Gesture):Boolean
{
if (gesture.target == otherGesture.target)
{
return true;
}

return false;
}

function gestureGcd(gesture:Gesture):void
{
gesture.gestureShouldReceiveTouchCallback = gestureShouldReceiveTouch;

gesture.gestureShouldBeginCallback = gestureShouldBegin;

gesture.gesturesShouldRecognizeSimultaneouslyCallback = gesturesShouldRecognizeSimultaneously;
}

singleTap = new TapGesture(gestureObj);

singleTap.numTapsRequired = 1;
//singleTap.delegate = gcd;
gestureGcd(singleTap);
singleTap.addEventListener(org.gestouch.events.GestureEvent.GESTURE_RECOGNIZED, onGesture);

zoom = new ZoomGesture(gestureObj);
//zoom.delegate = gcd;
gestureGcd(zoom);
//zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_RECOGNIZED, onGesture);
zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_BEGAN, onGesture);
zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_CHANGED, onGesture);

GestureState.Failed happening "randomly" during TransformGestures

Hi!

I'm using the TransformGesture, and when I click-drag-release a lot in succession, at some point I'll get a GestureState == FAIL.

The visual result: the object moves---moves---moves--- and then MISS! The mouse moves, but the object doesn't (cause the gesture failed).

Is there a way I can print out what the failure is in order to troubleshoot what is happening? It's very random - I can't quite understand why it's failing.

Sometimes, once I miss a click, I can keep doing the same translation with my mouse and keep getting the failure again and again. But the second I vary the timing or movement, it picks it up again and starts working.

Any ideas on how to solve or troubleshoot would be greatly appreciated.

Thanks!

Recommended way for one gesture to have priority over another

I have a movieclip with a SwipeGesture associated with it, and a PanGesture attached to one of it's children. I'd like to have the PanGesture on the child take precedence over the Swipe on the parent...

What's the recommended way to do this?

Would I use "requireGestureToFail"?

Are "canBePreventedByGesture" and "canPreventGesture" implemented fully at this point? I can't tell from the source code... Neither one seems to do anything.

I want to using Gestouch on Flash CS6

I add the codes. Program dont show error. But it dosnt work. Everything is ok but doent work

import org.gestouch.events.GestureEvent;
import org.gestouch.gestures.ZoomGesture;

var zoom:ZoomGesture;

zoom = new ZoomGesture(image);
zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_BEGAN, onGesture);
zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_CHANGED, onGesture);

function onGesture(event:org.gestouch.events.GestureEvent):void {
    const gesture:ZoomGesture = event.target as ZoomGesture;
    trace("Deneme");
    var matrix:Matrix = image.transform.matrix;
    var transformPoint:Point = matrix.transformPoint(image.globalToLocal(zoom.location));
    matrix.translate(-transformPoint.x, -transformPoint.y);
    matrix.scale(gesture.scaleX, gesture.scaleY);
    matrix.translate(transformPoint.x, transformPoint.y);
    image.transform.matrix = matrix;
}

DoubleTapGestureEvent localX bug?

Hello,

I just downloaded Gestouch and try it on a Samsung Galaxy Tab:

DoubleTapGesture.add(stage);
stage.addEventListener(DoubleTapGestureEvent.GESTURE_DOUBLE_TAP, onDoubleTapGesture);

private function onDoubleTapGesture(event:DoubleTapGestureEvent):void {
    var sprite:Sprite = new Sprite();
 sprite.graphics.lineStyle(25, Math.random()*0xFFFFFF);
 sprite.graphics.drawCircle(0, 0, 80);
 sprite.x = event.localX;
 sprite.y = event.localY;
 addChild(sprite);
}

And the sprite is always located at x:0 y:0 (localX and stageX)

Is it a bug?

Pan with two fingers

Hi
I have an image which can be transformed (pan and zoom) while the user can draw on it with one finger (longPressGesture). So i want to draw with one finger and pan with two fingers. How can i set the the pan gesture to require two touches?

Gesture Location Coordinate Plane

It seems like the Gesture.location parameter is always returned as a point in the global coordinate space rather than in the Gesture.target space. Is this intentional or am I misusing the interface somehow?

This makes Starling integration more complicated, especially because the contentScaleFactor is not taken into account when reporting the touch location. That means in order to use the Gesture.location value the developer must:

  1. Translate it from Global to the Gesture.target
  2. Divide the X and Y values by the Starling contentScaleFactor (if applicable)
  3. Translate the X and Y values depending on if the Gesture.target resides at (0,0)

I realize these aren't necessarily the responsibility of the GesTouch engine, but it would be great to see a more straightforward way to benefit from the Gesture.location value.

Excellent work by the way!

Feathers support

Are there any plans to adapt Gestouch to work with the current version of Feathers?
I'd love to use this library with Feathers as it worked great with my Flex projects.

I've seen the Starling support, but that does seem outdated by now.

How to move tracked TouchPoints from one TransformGesture to another?

Hello,

I have a scenario where this is needed. I have 2 different TransformGestures with different targets and if TransformGesture A realized that it has more than 2 touch points it should be stopped and the touch points should be taken over by TransformGesture B. TG B should be able to perform scaling with these touch points there after. How can I achieve this?

I try to do these because of some performance issues on Starling. I realized, if I use 2 finger gestures on Starling on a Sprite object with some sub-objects (some more sprites as children) the performance deterioriates totally.

However if I use a transformGesture on a Sprite/Image object with no children the two finger gestures perform super great and everything runs very smooth.

If I try to scale from within TG A the target of TG B for some reasons (maybe because of the target of TG A) it does not work out.

Thanks,
Henning

StarlingInputAdapter

Hi Pavel, nice work with Gestouch. It's incredibly usefull!

I needed to remap the 'input' directly to Starling stage for some reasons on my project.

To solve this problem, i create StarlingInputAdapter that listen to Starling touch events

It's not perfect but i think it can be a good start point. Maybe this can be useful for someone else too.

package org.gestouch.input {
    import flash.ui.Multitouch;
    import flash.ui.MultitouchInputMode;

    import org.gestouch.core.IInputAdapter;
    import org.gestouch.core.TouchesManager;
    import org.gestouch.core.gestouch_internal;

    import starling.display.Stage;
    import starling.events.Touch;
    import starling.events.TouchEvent;
    import starling.events.TouchPhase;


    public class StarlingInputAdapter implements IInputAdapter {
        protected var _stage:Stage;

        use namespace gestouch_internal;


        public function StarlingInputAdapter(stage:Stage) {
            super();

            if (!stage) {
                throw new ArgumentError("Stage must be not null.");
            }

            _stage = stage;
        }


        protected var _touchesManager:TouchesManager;
        public function set touchesManager(value:TouchesManager):void {
            _touchesManager = value;
        }

        public function init():void {
            _stage.addEventListener(TouchEvent.TOUCH, starlingTouchHandler);
        }

        private function starlingTouchHandler(event:TouchEvent):void {
            var touche:Touch;
            var i:int;
            var n:int = event.touches.length;

            for (i = 0 ; i < n ; i++) {
                touche = event.touches[i];

                if (touche.phase == TouchPhase.BEGAN) {
                    _touchesManager.onTouchBegin(touche.id, touche.globalX, touche.globalY, null);
                } else if (touche.phase == TouchPhase.ENDED) {
                    _touchesManager.onTouchEnd(touche.id, touche.globalX, touche.globalY);
                } else if (touche.phase == TouchPhase.MOVED) {
                    _touchesManager.onTouchMove(touche.id, touche.globalX, touche.globalY);
                }
            }
        }

        public function onDispose():void {
            _touchesManager = null;

            _stage.removeEventListener(TouchEvent.TOUCH, starlingTouchHandler);
        }

    }
}

Can GesTouch used in Flash Professional?

Hi,

Can GesTouch used in Flash Professional?
I've go through all the example and it is all in Flex.

Sorry for I'm a beginner to implement Flex to Flash.
Can I have the sample how to code in Flash? I'm using GesTouch in my old projects.

Thanks!

Call for support

Just an informational message.

I've finally acquainted with Apple's UIGestureRecognizer (damn why not before? ehh Obj-C looks so scary..), why I find very good now. In short: I had kinda similar thoughts, but well Apple put "slightly" more effort in it, thought of some special use-cases.. So I'm trying to rewrite Gestouch to make... well, can't call it "port" since neither they provide source code, nor I set the task "to make a port". I'd say "port of concept".
I've just published a new commit into develop branch and also updated examples project. There's several TODOs, but it seems like the basics are done.
These 3 videos will explain the basic concept:

and I'm REALLY looking forward for some feedback.

Android SwipeGesture GestureEvent.GESTURE_BEGAN

Hi,

I want to use the API for this simple Code: My Project is an Adobe Air Mobile Project, with the latest AIR SDK and compiled to Flash Player Version 11.7

_swipe = new SwipeGesture(this);
_swipe.addEventListener(org.gestouch.events.GestureEvent.GESTURE_RECOGNIZED, onGesture);
_swipe.addEventListener(org.gestouch.events.GestureEvent.GESTURE_STATE_CHANGE, onGestureStateChanged);
_swipe.addEventListener(org.gestouch.events.GestureEvent.GESTURE_BEGAN, onGestureBegan);

The GESTURE_BEGAN Event never fired, only the GESTURE_RECOGNIZED Event works. Did I miss something?

I need the the following Events:

GESTURE_BEGAN, GESTURE_CHANGED and GESTURE_ENDED

Best regards

Christian

org.gestouch.events ? v0.4.1

Hello, I am looking to try out your library but I can't get this version working with the examples. org.gestouch.events had many classes deleted.
Any help would be great!
Thanks!

Memory leak

While using starling gestouch , the ram of flash.display.DisplayObject can not be recycled after be clicked.

I found the issue is caused by "Gestouch.inputAdapter ||= new NativeInputAdapter(....);"

PanGesture minNumTouchesRequired & maxNumTouchesRequired?

var panA2D:PanGesture = new PanGesture(stage);
panA2D.addEventListener(PanGestureEvent.GESTURE_PAN, onPanSequence);
panA2D.minNumTouchesRequired = 2;
panA2D.maxNumTouchesRequired = 2;

the listener fire with 1 and 2 touchs ?

where am i wrong ?
regards

TapGesture with event.target.name

Hello,
I have a Sprite with several buttons in it, the buttons have names that are used to create new objects. Before Gestouch I used MouseClick, so event.target.name worked fine. Now with tap it doesn't. How can event.target.name be used with the TapGesture?

detect a touch of an object beneath a gesture layer?

Please let me know if there is a better place to ask GesTouch questions that are not related to Starling. Meanwhile:

I'm using the freeTransform to manipulate objects. I don't want the user to have to actually touch the object, which may be scaled quite small at the time. This is easily achieved by having a transparent movieclip that sits on top of the objects layer, and that's the movieclip passed in when making the freeTransform.

I do want the user to be able to select a different object, which may or may not be beneath the currently selected object, but no matter what, it will be beneath the transparent gesture layer movieclip.

What would be a way to detect a single finger touch on the lower level object without triggering the freeTransform Change event in the gesture overlay movieclip?

gesture.touchesCount on GESTURE_ENDED it's possible?

Hi Fljot.

I found an issue using transformeGesture, when I tried to know how many fingers are on the screen in GESTURE_ENDED, it was always 0.

I'm using gesture.touchesCount.

I also tried using a boolean in GESTURE_CHANGED, but looks like GESTURE_ENDED call GESTURE_CHANGED before it close.

There is another way to know how many fingers are on the screen in GESTURE_ENDED?

Thanks

Sebas.

swipe example?

I have seen example code for setting a display object for a SwipeGesture instance, but I can't find any example code that shows what listeners you would add, and how the listener function would look. Are there any examples online for using Gestouch for handling swipes?

TapGesture maxTapDelay

Hi fljot,

We don't see a difference in gesture recognition timing when we change the tap.maxTapDelay value. Shouldn't this alter the timer duration associated with the TouchEnd detection of the TapGesture class or is that not its intended purpose?

We're still working from the slop-hotfix branch you created a few weeks back.

Thank you!

resetNotificationProperties bug in ZoomGesture

It appeares that the line
_scaleX = _scaleY = 1;
in resetNotificationProperties() in ZoomGesture causes the scale values of the gesture to always be 1 or near 1. Commenting this line out allows me to use the gesture. Might require a little review.

problem with reactivating swipe event

Hi there,

I am having an issue where if I have a swipe event added to an object on the stage, and then I addChild another MovieClip on top of the object that has the swipe event, when I remove the object on top, the swipe event no longer fires.

This is the case even if I remove and then replace the event listeners, or even remove and replace the entire object

Could you perhaps explain best way to add and remove the swipe event listener from the bottom layer object so that it can be activated/deactivated?

many thanks!

Memory Leak With TapGesture

We are experiencing a nasty memory leak from the TapGesture class within a Starling based project. Basically we have a Sprite class which contains a number of dynamically created Sprites, each one having a tap function. Within the creation function we set up tap event listeners like so:

var tap:TapGesture = new TapGesture(item);
tap.addEventListener(GestureEvent.GESTURE_RECOGNIZED, onTap, false, 0, true);

Where item is the Sprite object we want to listen to for taps. Even though the event is specified as weakly referenced, adding this line will cause the item and it's parent to be held in memory forever. I've done rigorous testing to determine that this is happening and this is the exact cause using manually called garbage collection calls and the Flash Builder memory profiler. Commenting the addEventListener line causes the sprites to be released from memory like normal.

I did a bit of poking around in the gestouch source and it looks like this cooould be because of a reference to the callback function (onTap in this case) being maintained in a dictionary (Gesture.as line 239). I didn't really do a thorough inspection of the source but that seemed like an obvious place to start looking.

Any insight into this issue would be appreciated. Thank you!

LongPressGesture not dispatching RECOGNIZED, ENDEN or CANCELLED states

Hey Pavel,

Thanks for your work.

I'm making a small demo for dragging a Starling object with a LongPressGesture of one finger and it works, it detects the Gesture properly but as i release my finger, i never got the GestureState.CANCELLED, GestureState.IDLE or GestureState.ENDED, i'm doing this the most basic way and i never get the GESTURE_RECOGNIZED or POSSIBLE, probably i'm missing something...

_longPressGesture.addEventListener(GestureEvent.GESTURE_CHANGED, onLongPressChanged);

and then checking what changed on the state.

I'm testing on a GalaxyTablet where other gestures have worked out fine, and also using the latest version of AIR

Thanks!
NAZ

Gesture Zoom Event Phase

How do I know gesture has finished

I try this but this not work.

zoom.addEventListener(org.gestouch.events.GestureEvent.GESTURE_STATE_CHANGE, onGestureEnd);

function onGestureEnd(event:org.gestouch.events.GestureEvent):void
{
switch (event.newState)
{
case GestureState.ENDED:
if(mv.scalex < 1)
TweenLite.to(mv, 0.5,{ scaleX:1, scaleY:1,x:0, y:0 , ease:Quint.easeOut });
break;
}
}

Thank you very,very much for Gestouch.

Swipe and Panning Image

Hi fjlot,

I have an issue whereby the swiping and panning listener are conflicting each other. I am trying to apply pan and zoom gestures to the image gallery and they work well initially. BUT, when I add the swipe gesture to the stage to change the view, they ain't working well. Sometimes, the image can be zoomed and panned but mostly both the gestures become unresponsive or delayed. Besides, it triggers the swipe event when i try to pan the image. Is there a work around for this?

Best regards,
Victor

How to set up in Flash CS6

Hi,

Laugh at me if you will, but I desperatly need to use your double tap function within in my IOS application but being a complete noob to coding and AS3 i have no idea how to set gestouch library up with in flash so its recognised when i write my script?

Is there a step by step instruction on the install of gestouch somewhere?

If not can you take me through the steps of making it active in flash CS6.

Thank you.

Multiple gestures on the same target

Hi,

Thank you for your framework, very helpful.

When I create 2 same gestures on the same target (tested with 2 TapGesture), only one is recognized. We should have the 2 gestures recognized.

Applying Gestouch in Flash movie with MAC touchpad

Hi, I would like to know if anyone has tried to use the Gestouch Event within a flash movie and trigger the multitouch event with MAC touchpad. I am a newbie to both flash and Gestouch. And I follow the tutorial to add the TapEvent to my flash movie and it works fine. But when I try to add the FreeTransform Event to my object in the movie like below:

var freeTransform:TransformGesture = new TransformGesture(myImage);
freeTransform.addEventListener(GestureEvent.GESTURE_BEGAN, onFreeTransform);
freeTransform.addEventListener(GestureEvent.GESTURE_CHANGED, onFreeTransform);
...
private function onFreeTransform(event:GestureEvent):void
{
// move, rotate, scale โ€” all at once for better performance!
trace(freeTransform.offsetX, freeTransform.offsetY, freeTransform.rotation, freeTransform.scale);
}

The FreeTransform event only trigger when I press down the left button of my MAC touchpad instead of just a tap. And I try to do the rotate and zoom gesture, the rotation and scale value are always 0 and 1 respectively. Anyone know why it would happened? Am I miss something in the configuration?

Thank for help!

Swipe.direction

I like being able to limit the direction of swipe checks, but for a lot of basic swipes it would be convenient if the SwipeGesture event came with a value already mapped to your Direction enum (ie. SwipeGestureDirection.LEFT) instead of the developer having to evaluate the offsetX and offsetY on their own. Something like SwipeGesture.actualDirection so it doesn't conflict with the current direction property you already have.

Just a suggestion, though. =)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.