Hi,
These situations are a bit tricky sometimes. The mouseDownOutside event
is usually what I use for this. Where it gets tricky is when there are
interactive children involved. If the children aren't interactive, you
can simply set the children's mouseEnabled property to false and you're
done. However if you need to click the DataGrid, the VBox's "out"
events are going to fire; because the children are layered on top of the
VBox. So, in the mouseDownOutside handler function you can check the
parent of the event. If it's the DataGrid, don't execute your code,
else it's actually outside. Something like:
private function onMouseDownOutside(e:Event):void
{
if (e.target is DataGrid) return;
// do your thing
}
-TH
--- In [email protected], "dev_oue" <[EMAIL PROTECTED]> wrote:
>
> Hi all !
>
> I have a container (VBox) with a datagrid in it (and other stuff)
> I need to react when the user clicks outside my Vbox ... but I don't
> know which event to listen to.
>
> myVBox.addEventListener(FocusEvent.FOCUS_OUT,handleMyVboxFocusOut);
> Actually I tried FOCUS_OUT and MOUSE_OUT, but both of them are
> dispatched even if I click inside the datagrid (child of my VBox) !!
:( :(
>
> The listener is on the Vbox, but it would be logical that a click on
> any of the children doesn't trigger the event, or maybe I don't get it
?
>