The dispatched event needs to be heard by any component, anywhere, by setting an event listener for it at the application level. So bubbling up to the app is critical.
--- In flexcoders@yahoogroups.com, "Manish Jethani" <manish.jeth...@...> wrote: > > On Mon, Jan 12, 2009 at 11:42 AM, biosmonkey <biosmon...@...> wrote: > > > In my main app, I instantiate an instance of this class. I also > > create an event listener at the application level. > > > > Here's the problem: > > > > * If I use dispatchEvent(...) inside MyClass, the event listener in > > the main app never fires (the custom event *is* set to bubble) > > To add to Josh's response, I would say the best way to do this is to > listen on the object itself. > > obj = new MyClass(); > obj.addEventListener(...); > > The events don't have to be bubbling then. > > Manish >