I don't really have any simple examples.

I did look at the documentation for the Button Class 
(http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#event:click)
 and noted the bubbles property is set to true so the button click should 
bubble up to your parent component.

So, add an event listener in the parent component to catch the event. If you 
have multiple buttons, you will have to check the event.target property to find 
out which button dispatched the event (hint: Add a breakpoint in your handler 
and check the event.target and event.currenttarget properties).

--- In flexcoders@yahoogroups.com, Angelo Anolin <angelo_ano...@...> wrote:
>
> Hi Valdhor,
> 
> Care to show some examples? Or some links? Thanks.
> 
> Angelo
> 
> 
> 
> 
> ________________________________
> From: valdhor <valdhorli...@...>
> To: flexcoders@yahoogroups.com
> Sent: Thu, 15 April, 2010 12:14:11
> Subject: [flexcoders] Re: MXML Component Call Event in Parent
> 
>   
> Make sure the event is set to bubble. Once it has, the event should bubble up 
> the chain to the parent where an event listener should catch it.
> 
> --- In flexcod...@yahoogro ups.com, Angelo Anolin <angelo_anolin@ ...> wrote:
> >
> > Hi FlexCoders,
> > 
> > I have created a component consisting of some buttons which I am using in 
> > another MXML component.
> > 
> > How would I trigger from the parent component an event which was done 
> > inside the component.  For example, I clicked on a button on the component 
> > which I embedded, that should map to an event on the parent containing the 
> > component.
> > 
> > I am looking to reuse the same component in other MXML files as well.
> > 
> > Thanks. Appreciate your inputs.
> > 
> > Regards,
> > 
> > Angelo
> >
>


Reply via email to