FLEX/AIR Dispatch Custom Events from Popup or between mxml components
Here is the way how we can achieve the thing dispatching custom events between components.
PopUp window:
<mx:script>
dispatchEvent( new Event(MyEvent.MY_DATA_CHANGED, true));
</mx:script>
Other mxml component:
<mx:script>
private function onClick():void {
var win:MyForm = PopUpManager.createPopUp(this, MyForm, true) as MyForm;
win.addEventListener(MyEvent.MY_DATA_CHANGED, onMyDataChanged);
}
private function onMyDataChanged(event:Event):void {
trace("DATA CHANGED");
}
</mx:script>
MyEvent:
public static const MY_DATA_CHANGED:String = "myDataChanged";
I hope this will help.