This content has been marked as final. Show 3 replies
My goodness this is tormenting my soul.
I've tried adding of 1 second before dispatching the event and the base class still isn't receiving notification.
I found the problem.
I was calling the function from another class. For some reason when I do this, the EventListener isn't called. But when I call the dispatchEvent function from within the EventDispatcher Object class, it works.
hope that makes sense, I'm trying to breeze through this quickly.
I suppose this morphs my question/problem into, why does this happen?
I am having virtually the same problem with event dispatch. I know what the problem seems to be (though it makes no sense), but I don't know of a good workaround.
If events are dispatched from a static class or from the base class, they never get beyond the target phase, so they are never propagated out of the scope of the class.
I suppose that you could instantiate a singleton, and dispatch your events from that using a method call, but that seems REALLY kludgy. Does anyone know of a better solution?