1 Reply Latest reply on Dec 19, 2013 10:31 AM by afukada

    how to scale a popup

    afukada

      I have a modal popup dialog defined in UserSelectPopup.mxml. It's a Spark SkinnablePopUpContainer.

      I use the following code to open it.

       

      var pop:UserSelectPopup = new UserSelectPopup();
      pop.addEventListener('close', popup_closeHandler);
      pop.open(this, true);
      PopUpManager.centerPopUp(pop);
      

       

      The parent application scales up and down depending on the size of the device it runs on, but the popup stays the same. How can I make the popup scale along with the parent application?

        • 1. Re: how to scale a popup
          afukada Level 1

          I feel stupid answering my own question. It was so straightforward and intuitive that I don't know why I missed it.

           

          var pop:UserSelectPopup = new UserSelectPopup();
          pop.addEventListener('close', popup_closeHandler);
          pop.open(this, true);
          pop.scaleX = pop.scaleY = info.scale; // info.scale is the main app's scaling ratio
          PopUpManager.centerPopUp(pop);