Quantcast
Viewing all articles
Browse latest Browse all 10

Note to Self – #1: AS3 Event Bubbling is only for objects on the display list

As a result of being back in the “land of the coding” (see post: http://blog.flexmonkeypatches.com/2010/09/08/back-in-the-land-of-the-coding/), I should begin easily to accumulate content for blog posts. Case in point last week, when I spun my wheels for what was longer than I should have, over dumb assumptions or misconceptions or misrememberings regarding some aspect of Flex/Flash/AS3. I thought I would start a new series of posts meant to capture such dumb assumptions as a reminder to myself ad hopefully as a cache of useful tidbits that others can come across when they are struggling with things that just aren’t working as they thought they should. Here are my first 2 entires in this the inaugural “Note to Self”:

AS3 Event Bubbling is only for objects on the display list!!

There may be reference to this in the docs and if I run across it, I will amend this post to include it. Now it would be nice if you could bubble events up the inheritance hierarchy or from one instance up to the class instance that contains the instance dispatching the event (and so on and so forth), but you can’t. There may be ways of doing this in a more clean manner, but really the underlying mechanism is really through a series of eventListeners that you must attach up through the hierarchy of object through which you want the events to pass. Don’t forget to implement the clone method of any custom events you are dispatching, otherwise you will run into trouble. Just implement clone and you can easily redispatch the event from within the listening function that receives the event.


Viewing all articles
Browse latest Browse all 10

Trending Articles