Create a Component using PopUpManager Class in Flex app.

January 4, 2008

In the PopUpManager Class there is a method to create a Component that is..

createPopUp(); 

Together it looks like..

PopUpManager.createPopUp(this,frmLogin,true);

This will Create PopUp .. if PopUp Exits then raises that Particular Object …

Here frmLogin is the name of the Component.. you have to create a component after writing this line of code otherwise it will show an error “undefined perperty .. “.

The first parameter sepcifies that component is an instance of that particular Object.

Secound parameter specifies the name of that Component.

The Third parameter specifies that Mode of display.. if true than modal,if false Nonmodal.


Centering a Component using PopUpManager in Flex app.

January 4, 2008

First step is to import the package needed here..

import mx.managers.PopUpManager;

Now we have to use the methods in the PopUpManager Class.

Using the Property creationComplete call a method as init() and in the method use the following line..as..

PopUpManager.centerPopUp(this);

This will center your Component on  creationComplete of that Component..

The Final Code looks like this..

<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function init():void
{
PopUpManager.centerPopUp(this);
}
]]>
</mx:Script>

Using This makes good designning.