DoubleClick on a container with children

So you want to have a double click event on an object ( lets call it a “parent” ) on the stage.  All you have to do is  to set it’s doubleCklickEnabled propriety to true then add a MouseEvent.DOUBLE_CLICK event to it.  The double click should fire.

BUT if you add some other objects ( lets call them children ) inside our parent you’ll see that the double click event is not fired as it should. Why’s that ?!!?

Well  … each of our children has their own mouse events which mess up our parent’s mouse events. The trick is to set tha parent’s mouseChildren propriety to  false. This will strip the children of their mouse events.

Now the double click should work.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s