This question is very crucial for my understanding of events. So please take a good look at and help make the concepts thorough.
Consider the figure below:
+---+
| 1 |
+---+
_____|_____
| |
+---+ +---+
| 2 | | 3 |
+---+ +---+
_____|_____
| |
+---+ +---+
| 4 | | 5 |
+---+ +---+
1 is the main default application. 2, 3, 4 are modules in flex terminology (simply swfs).
1 loads 2, 3. 3 loads 4, 5.
2 doesn’t know about 3, 4, 5.
4 doesn’t know about 5 even if both are loaded by 3. Say modules are independent.
i) Module 4 dispatches an event (flash.events.Event). Will module 2 get that event? Will module 2 get it in any cases like setting capture == true ?
ii) When module 4 dispatches an event where does that event first begins or originate? Or in other words in which place does that event gets fired?
Is it from 1 -> 3 -> 4 in capture phase (which is set to false by default)? And from 4 -> 3-> 1 in bubbling phase (if bubble is set to true)? Right?
iii) Why is capture phase computationally expensive and not commonly used (from livedocs)?
iv) When ever an event is dispatched it actually originates from the top most level (stage), true or false ?
Thank You