Create PopUp Window in Adobe AIR / FLEX, A simple Example.

By | February 23, 2011

Below code shows how to create a new popUp window in Adobe AIR or FLEX.
To create a new window “right click on the src folder and create a new MXML Component named Here “MyLoginForm” It should be aTitleWindow for the example below.
How ever You can create other components, but the code accordingly must change.

          import mx.managers.PopUpManager;
          import mx.core.IFlexDisplayObject;
          import myComponents.MyLoginForm;

          // Additional import statement to use the TitleWindow container.
          import mx.containers.TitleWindow;

          private function showLogin():void {
            // Create the TitleWindow container.
            var helpWindow:TitleWindow =
          TitleWindow(PopUpManager.createPopUp(this, MyLoginForm, false));

            // Add title to the title bar.
            helpWindow.title="Enter Login Information";

            // Make title bar slightly transparent.
            helpWindow.setStyle("borderAlpha", 0.9);

            // Add a close button.
            // To close the container, your must also handle the close event.

Leave a Reply

Your email address will not be published. Required fields are marked *