2 Replies Latest reply on May 24, 2009 9:31 AM by DHTVP

    passing arguments to PopUp

    Mohd Fayaz Level 1

      Hi all,

       

      How can we pass arguments(like strings, array etc.) to PopUp window. I am using TitleWindow class to create PopUp.

        • 1. Re: passing arguments to PopUp
          Michael Borbor Level 4

          If your component that you are goung to use as a PopUp declare a variable as public and it'll be accesible from your parent app.

          1 person found this helpful
          • 2. Re: passing arguments to PopUp
            DHTVP Level 1

            From the parent, you can call the PopUp with something like this:

             

            public var yourvariable:String = "Hello!";

             

            public function callPopup():void {
                var thePopUp:YourPopUp = PopUpManager.createPopUp(this, YourPopUp, true) as YourPopUp;

                //you can set the popups title with this if you want

                thePopUp.title = "Some Title";

             

                //here you send a variable to the popup
                thePopUp.varInPopUp = yourvariable;

                //style the popup if you want

                thePopUp.setStyle("borderAlpha", 0.9);

             

                //center the popup
                PopUpManager.centerPopUp(thePopUp);
            }

             

            Then in your TitleWindow, simply declase the varInPopUp like this:

             

            [Bindable]

            public var varInPopUp:String;

             

            Then you can simply use it in the TitleWindow.

            1 person found this helpful