Skip navigation
Currently Being Moderated

How can I get Skinnable -Popup-Container in the center of my app?

Jul 30, 2012 4:11 AM

Tags: #flex-mobile #skinnablepopupcontainer #android #actionscript #center #4.5.1 #flex4.5 #pop_up #mobile_air #popups #popup_window

I have a component based on SkinnablePopUpContainer. I am using 4.5.1 sdk.

I need to pop it up on the very center of my application.

 

But the open() does not give any parameters as such to specify that.

 

Sample code for showing popup is:

  var popup: MyCustomPopUp = new MyCustomPopUp ();

  popup.open( the name of my project file  ,true);

                                                            popup.verticalCenter =0;

                                                            popup.horizontalCenter =0;

 

Even after mentioning the verticalCenter and horizontalCenter as 0, the popup opens automatically on the left hand side of the screen.

 

If I use PopUpManager class then it works fine.But for my mobile application, I dont want to use PopUpManager Class.

 

 

Please suggest a solution for this.

 
Replies
  • Currently Being Moderated
    Sep 22, 2012 3:08 PM   in reply to komal harkut

    Not exactly a solution, but a possible workaround is to set the x & y values manually.  Not ideal for different screen sizes but it helped me.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 25, 2012 7:55 AM   in reply to komal harkut

    I have used the following and it centers correctly on the application:

     

     

                                                      popup.open(UIComponent(parentApplication), true);

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 15, 2012 5:50 AM   in reply to komal harkut

    Sorry Komal, I only looked at the use of my component, not the actual code of it.  We have a component that uses SkinnablePopupContainer and modifies its appearance.

     

    What you'll need to do is create your SkinnablePopupContainer and using a Group, or VGroup as you see fit, center the Panel object on the screen.  We use the SkinnablePopupContainer's Render function to update the size of the Panel.  This is needed if your application may be rotated by the user while the Popup is open.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points