1 Reply Latest reply on Apr 9, 2010 2:44 AM by Flex3Noobler

    How do i close a Popup window from my Main window

    Flex3Noobler Level 1

      Consider i have two mxml file one is the

       

      Main.mxml

      PopupTitlewindow.mxml

       

      I am opening a title window from my Main.mxml by using

       

      PopUpManager.createPopUp(this,PopupTitlewindow,true);

       

      I want to close the popup window from my Main.mxml not from PopupTitlewindow.mxml .How to do it ?

       

       

       

       

      Regards,

      Rahul.

        • 1. Re: How do i close a Popup window from my Main window
          Flex3Noobler Level 1
          <?xml version="1.0"?>
          <!-- containers\layouts\MainMyLoginFormRemove.mxml -->
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

              <mx:Script>
                  <![CDATA[
                    import mx.managers.PopUpManager;
                    import myComponents.MyLoginForm;
                    import mx.core.IFlexDisplayObject;

                    private var helpWindow:IFlexDisplayObject;

                    private function showLogin():void {
                      // Create the TitleWindow container.
                      helpWindow = PopUpManager.createPopUp(this, MyLoginForm, false);
                    }

                    private function removeForm():void {
                      PopUpManager.removePopUp(helpWindow);
                    }
                  ]]>
              </mx:Script>
             
              <mx:VBox width="300" height="300"> 
                  <mx:Button click="showLogin();" label="Login"/>
                  <mx:Button id="b2" label="Remove Form" click="removeForm();"/>
              </mx:VBox>


          Guys sorry i got the solution for the problem i posted .



          Regards,
          rahul.
          </mx:Application>