Actually, I did think about that and tried changing from EventDispatcher to extending UIComponent but it still does not work. I even tried Canvas and it still does not catch it.
As an experiment, though, I tried dispatching the same event from one of my components elsewhere in the application just to make sure the custom event itself was OK, and that worked. Does it make a difference that I am dispatching this event from inside an HTTPService callback? Basically, the way this class works is that I instantiate it with a timer value, and every x seconds it makes a call to the server to get some data, and based on the result of that data I dispatch an event with the payload. --- In [email protected], "Josh McDonald" <dzn...@...> wrote: > > Event bubbling only occurs within the display list. So your dispatching > object must also be a child UIComponent if you want to catch bubbled events. > > -Josh > > On Mon, Jan 12, 2009 at 4:12 PM, biosmonkey <biosmon...@...> wrote: > > > I thought I had understood the event model, but apparently not. > > > > I have a custom class that extends EventDispatcher, let's call it > > MyClass. This class will periodically dispatch a custom event based > > on a timer and some condition. > > > > 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) > > > > * The only way it will work is if I use the application object, ie > > mx.core.Application.application.dispatchEvent(...) > > > > But I don't understand why I have to do this? I have used a similar > > model just fine when dispatching events from inside components (ie I > > use dispatchEvent and my custom event is heard at the app level via > > bubbling). > > > > Can someone help me understand this? > > > > > > ------------------------------------ > > > > -- > > Flexcoders Mailing List > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > > Alternative FAQ location: > > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > > Search Archives: > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > > Links > > > > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > Like the cut of my jib? Check out my Flex blog! > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: j...@... > :: http://flex.joshmcdonald.info/ > :: http://twitter.com/sophistifunk >

