Giter Club home page Giter Club logo

Comments (2)

fljot avatar fljot commented on July 28, 2024

Gestouch doesn't stop any events propagation. Everything works just fine.

package {

import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TouchEvent;

import org.gestouch.core.Gestouch;
import org.gestouch.events.GestureEvent;
import org.gestouch.extensions.native.NativeDisplayListAdapter;
import org.gestouch.extensions.native.NativeTouchHitTester;
import org.gestouch.gestures.PanGesture;
import org.gestouch.input.NativeInputAdapter;

public class Main extends Sprite {

    public function Main() {

        Gestouch.inputAdapter = new NativeInputAdapter(stage);
        Gestouch.addDisplayListAdapter(DisplayObject, new NativeDisplayListAdapter());
        Gestouch.addTouchHitTester(new NativeTouchHitTester(stage));

        var pannable:Sprite = new Sprite();
        addChild(pannable);

        var pan:PanGesture = new PanGesture(pannable);
        pan.addEventListener(GestureEvent.GESTURE_BEGAN, onPan);
        pan.addEventListener(GestureEvent.GESTURE_CHANGED, onPan);

        var child:Sprite = new Sprite();
        child.graphics.beginFill(0xCCCCCC);
        child.graphics.drawCircle(0, 0, 100);
        child.graphics.endFill();
        child.addEventListener(MouseEvent.CLICK, onChildTouch);
        child.addEventListener(TouchEvent.TOUCH_BEGIN, onChildTouch);
        child.addEventListener(TouchEvent.TOUCH_END, onChildTouch);
        pannable.addChild(child)
    }

    private function onPan(event:GestureEvent):void
    {
        trace("gesture recognized", event);
    }

    private function onChildTouch(event:Event):void
    {
        trace("child interactive event", event);
    }
}
}

from gestouch.

PippoFlash avatar PippoFlash commented on July 28, 2024

Weird since it doesn't work to me. I had to implement event tunneling, probably because I use a personal events framework quite complex, it gets in the way somehow. Thank you for your answer.

from gestouch.

Related Issues (20)

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.