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?

Reply via email to