Hi Paul ,

I'm not 100% sure about this but ..

How about ..

Application.application.addEventListener(..) ?

This should get caught if the Event bubbles ( bubbles = true )  .. If
not then you can
specify a specific listener and then re-dispatch the event with bubbles
= true ..

eg:

function  catchEvent(e:Event)
{
        var myE:Event = new Event(e,true);
        dispatch(myE);
}




--- In flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ,
"paulwelling" <[EMAIL PROTECTED]> wrote:
>
> Hello Roman,
>
> I am trying to avoid spec'ing who will do the dispatching and just
> have my component listen for the event no matter who dispatches it.
>
> Any ideas?
>
> The A.addEventListener(..) seems to couple more than I want...
>
> Thanks,
> Paul
>
>
> --- In flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
, "Roman Protsiuk"
> roman.protsiuk@ wrote:
> >
> > When you are adding an event listener the only thing that tells who
> is to
> > dispatch the event is who's addEventListener() is called. I mean if
> you are
> > calling addEventListener(...) this means that you are listening to
> 'this'
> > that will dispatch the event. If a.addEventListener(...) then 'a'
will
> > dispatch it.
> >
> > What you need is smth like:
> > instanceOfA.addEventListener("myEvent", myBListenerFunc);
> > inside of the B instance.
> >
> > R.
> >
> > On 30 Mar 2007 08:25:28 -0700, paulwelling pwelling@
> > wrote:
> > >
> > >   Hello,
> > >
> > > Question on disipatching events that I hope someone can clear
up...
> > >
> > > I have two custom components, A and B created at the Application
> level.
> > >
> > > I want to send a custom event from A to B.
> > >
> > > Inside of B creationComplete, I have addEventListener("myEvent",
> > > myBListenerFunc);
> > >
> > > Inside of A, on a button click, I dispatchEvent(new
Event("myEvent"))
> > >
> > > Obviously I would like the function on B, myBListenerFunc() to be
> > > called, but is not.
> > >
> > > I'm sure I can do this without having to tell B that A is the
> > > dispatcher (in B, A.addEventListner("myEvent",myBListnerFunc);)
> > >
> > > Thanks,
> > > Paul
> > >
> > >
> > >
> >
>

Reply via email to