I use a popup loaded from different MXML file:
private function showAddPopUp():void{
addPopUP = PopUpManager.createPopUp(this, add_popup, true);
PopUpManager.centerPopUp(addPopUP);
}
That file is as follows (add_popus.mxml):
<mx:VBox width="100%" height="100%" paddingLeft="5" paddingTop="5" paddingRight="5" paddingBottom="5">
<mx:Label text="Enter name of the source:" />
<mx:TextInput width="100%" id="textName" />
<mx:Label text="Enter URL for the source:" />
<mx:TextInput width="100%" id="textURL" />
<mx:HBox width="100%">
<mx:Button label="OK" id="buttonOK" textAlign="center"/>
<mx:Button label="Cancel" id="buttonCancel" click="PopUpManager.removePopUp(this)" textAlign="center"/>
</mx:HBox>
</mx:VBox>
The problem is I don't know how to pass text values from text inputs to the main component after buttonOK is clicked in the popup. I tried custom events, but it didn't work. Documentation is not very helpful. I will appreciate any ideas.
Full code is here: http://github.com/jbajor/Newspapair