views:

186

answers:

1

I've got a flex project that I'm working on. Currently I've got a popup that consists of another mxml file containing a form.

Once the form is filled in and submitted I'd like to run another function then the popup closes on the main mxml file, but I'm not sure how to go about doing this?

Here's my popup code

    private var weightadd:weight_add; //POP UP ADD WEIGHT FORM 
    private function weightAdd():void {
    weightadd = new weight_add();
    PopUpManager.addPopUp(weightadd,this,true);
    PopUpManager.centerPopUp(weightadd);
    }   

Currently in my weight_add.mxml file I'm using a button to close the popup, I'd like have this button close the popup and then call a function in my main.mxml file - I'm just wondering how I go about doing this.

<mx:Button x="186" y="83" label="Cancel" styleName="formbutton" id="cancel_button" click="PopUpManager.removePopUp(this);"/>

Thanks!

A: 

I found this example which seem to do the trick

http://bubutripathy.wordpress.com/2007/02/09/popup-login-window

Adam