Solved

What is event bubbling in flash(as3) and flex

Posted on 2011-02-17
5
628 Views
Last Modified: 2012-05-11
What is event bubbling in flash(as3) and flex? and how can we use event bubling in as3?
0
Comment
Question by:naveenm_006
  • 2
5 Comments
 

Author Comment

by:naveenm_006
ID: 34923643
What is the use of event bubling? is this concept or technique?
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 250 total points
ID: 34924384
Flex' event handlich consists of 3 phases ... first is the capturing phase, then comes the targeting phase and after that comes the bubbling phase.

If in a Flex application you click on a button, the click event is recieved at the flash player. In the capturing phase the flash player starts at the root of the application and goes down the tree to find the component that was clicked.
After the component is found, in the targeting phase the event listeners of that component are triggered.
In the bubbling phase the event "bubbles" back down to the root and allows parent components to react on the event.

You have to explicitly tell an event that it can bubble, otherwise this phase will be skipped. You have to explicitly tell an event listener that it should monitor the targetting phase. With an event Listener that listens to the targetting you could be able to "capture" an event and prevent it from targetting a child of the current component.

I usually use bubbling, if I don't want to attach too many event listeners to a component. If for example an ItemRenderer of a list fires a custom "objectxupdated" event then without bubbling I would have to attach a listener to every item. With bubbling I can attach one listener to the list and as soon as the custom event comes bubbling up, I can catch it.

Hope it explains things a little :)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 34924574
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35414143
Oh common' ... the third Question I answered, that you want to be deleted? Please close the issue assigning the points. Otherwise I will deffinitely never answer one of your questions again.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adobe flex charting question 3 263
looking for noob/pro flash game developers to grow with 4 653
how to edit swc file 3 540
[HELP PLEASE] -- calc columns in datagrid 13 475
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now