Search code examples
flashactionscript-3apache-flexeventsdispatchevent

Flex Event Handling


Folks,

I had a doubt in Flex's event handling and dispatching mechanism.

Consider the below diagram,

Both Panels i.e Panel1 and Panel2 are under the same application.

enter image description here

I want to dispatch an event on click on Send Button, and be able to listen for that event by adding event listener on Receive Button.

How can I do that ?

PS : Since, AFAIK, dispatchEvent only dispatches event up the Parent Hierarchy. Is that right ?

Thanks.


Solution

  • No, you can't. But if you really want to handle events cross views or components without adding too many dependencies, I suggest you take advantage of frameworks like Parsley and their messaging features.

    http://www.spicefactory.org/parsley/