Separate left click on stacked items

Hi

Having a panel with an image on it,
While clicking on the image, we would like not having the panel click fire.
we thought of setting a variable on the image click, and then check it on the click function of the panel.
is there a better way?

thanks

There are at least two ways you could proceed.

You could define a click event handler on the Picture which is a no-op except for setting InputEvent.handled to true, to prevent bubbling of the InputEvent up the chain of Panels.

Or in your existing click event handler on the Panel you could check whether the InputEvent.targetObject is the Picture that you want to avoid responding to.

I’m not sure which alternative would make the most sense for your requirements.

thank you,
and code sample of how to use it?

click: function(e) { e.handled = true; }