0

I am creating an android presentation app for a tablet that is projected on a screen. I have created a TouchEvent the adds a circle sprite so the audience can see where the presenter clicked on the screen. Here are the functions:

public function onTouchBegin(e:TouchEvent):void
    {
        var dot:Sprite = this.getCircle();
        dot.x = e.stageX;
        dot.y = e.stageY;
        stage.addChild(dot);
        dot.startTouchDrag(e.touchPointID, true);
        dots[e.touchPointID] = dot;     
    }

    public function onTouchEnd(e:TouchEvent):void
    {
        var dot:Sprite = this.dots[e.touchPointID];     
        stage.removeChild(dot);         
        delete this.dots[e.touchPointID];
    }

    private function getCircle(circumference:uint = 20):Sprite
    {
        var circle:Sprite = new Sprite();
        circle.graphics.beginFill(0x00AFF0, .3);
        circle.graphics.drawCircle(0, 0, circumference);
        circle.mouseChildren = true;
        return circle;
    }

This works great, but I have some movieclips on the stage that cannot be clicked because the touch event is hijacking the click event. How do I get the click event assigned to the movieclips to fire through the dynamically added sprite?

4

1 回答 1

0
circle.mouseEnabled = false;

您可以简单地禁用鼠标与圆圈的交互。

于 2013-07-12T18:22:32.923 回答