3 Replies Latest reply on Mar 15, 2012 11:21 PM by Patel Bharat

    PopUpManager issue

    jfb00 Level 3


      I am getting an error in flex sdk 4.6 for PopUpManager, i am trying to center the window, it works in sdk 4.5.1.

      If I use this instead of this.parentDocument as DisplayObject, it works but it doesn't center the window.


      win=My_Screen(PopUpManager.createPopUp(this.parentDocument as DisplayObject, My_Screen, true));



      Any ideas?


        • 1. Re: PopUpManager issue
          Sathyamoorthi Level 2

          what "this.parentDocument" refres? popup will be centered to "this.parentDocument".

          • 2. Re: PopUpManager issue
            jfb00 Level 3

            Thanks for you help and reply.

            I have an app that will have a controlBarContent at top and a module at the bottom.

            From the module i want to open this popUp screen, it works but it is centring the only in the module not in the whole browser screen.

            With this.parentDocument i point to the main app but looks like it is different in sdk 4.6. i try also this.parentApplication and it works but also centering on the module.

            I hope someone can help.


            • 3. Re: PopUpManager issue
              Patel Bharat Level 2

              Hi try below code, which will open center popup window



              <?xml version="1.0" encoding="utf-8"?>

              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"


                                               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">


                                  <!-- Place non-visual elements (e.g., services, value objects) here -->




                                  <s:Button id="btn"

                                                        label="Show TitleWindow"

                                                        click="btn_click(event);" />





                                            import MyTitleWindow;

                                            import mx.managers.PopUpManager;


                                            protected function btn_click(evt:MouseEvent):void {

                                                      var ttlWndw:MyTitleWindow = PopUpManager.createPopUp(this, MyTitleWindow, true) as MyTitleWindow;







              MyTitleWindow component as below:


              <?xml version="1.0" encoding="utf-8"?>

              <s:TitleWindow name="MyTitleWindow"




                                               title="Spark TitleWindow title"

                                               width="300" height="200"





                                            import mx.core.IFlexDisplayObject;

                                            import mx.events.CloseEvent;

                                            import mx.managers.PopUpManager;


                                            protected function ttlWndw_close(evt:CloseEvent):void {

                                                      PopUpManager.removePopUp(evt.currentTarget as IFlexDisplayObject);







              Hope this could be helpful.