FLEX: how to ignore MouseEvents from the container ?

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-05-05T19:25:51Z Indexed on 2010/05/05 19:28 UTC
Read the original article Hit count: 122

Filed under:

hi,

I've some objects on the canvas, and I added eventListeners to these objects for MOUSE_UP event.

I'm know checking if it works by tracing e.target.name, and I found out that the event is triggered twice, before on the element container (Canvas) and then the element itself.

I read several times the documentation about Capture, Bubbling etc.. but I don't understand how to trigger the events only from the element itself...

child.addEventListener(MouseEvent.MOUSE_UP, updateSelectedTags);

private function updateSelectedTags(e:MouseEvent):void {

                Alert.show(e.currentTarget.name); //I have 2 alerts, one for canvas, the other one for the child
            }

        }

thanks

© Stack Overflow or respective owner

Related posts about flex