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...@yahoo.com> 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...@gfunk007.com
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk

Reply via email to