Solved

What is event bubbling in flash(as3) and flex

Posted on 2011-02-17
5
640 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as the high-speed power of the cloud.

Question has a verified solution.

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

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…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

628 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