| Author |
Need some help in understanding Capturing Phase .
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2231
|
|
Hi ,
I have some confusion in understanding Capturing Phase .
I have described a scenario below , please let me know will this be an example for Capturing Phase ??
Assume i have a Form containing a Button inside a Application Container .
When the Button is clicked on the Form , if i add a Event Listener using this.addEventListener(MouseEvent.click , callMe)
Will this be an exmple of an Capturing Phase ??
Please guide me
|
Save India From Corruption - Anna Hazare.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
No. The capturing phase occurs when the event is fired, regardless of whether you have attached an event listener. The capturing phase is when the player examines the target and it ancestors to see if there are listeners available for an ever of this type. If you want to watch it happein, stick a break point in your code and step through te calls.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2231
|
|
Paul Thanks for the prompt reply ,
Sorry for not posting the full code , i am assuming that the User has clicked a Button and button has a Event Listener in which it will dispatchEvent(new MouseEvent(MouseEvent.CLICK))
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Why would you attach an event listener to dispatch the same event it listens for?
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2231
|
|
You are right as the Flex Framework will do this job .
Thanks
|
 |
 |
|
|
subject: Need some help in understanding Capturing Phase .
|
|
|