Creating custom dialog boxes using the PopUpManager and TitleWindow classes
Here are a couple examples of using the TitleWindow container with the PopUpManager class to create custom pop-up windows and dialog boxes.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Label;
import mx.events.CloseEvent;
import mx.containers.TitleWindow;
import mx.managers.PopUpManager;
private var titleWindow:TitleWindow;
private function init():void {
var label:Label = new Label();
label.text = "Hello world";
titleWindow = new TitleWindow();
titleWindow.title = "Custom title";
titleWindow.showCloseButton = true;
titleWindow.width = 240;
titleWindow.height = 180;
titleWindow.addEventListener(CloseEvent.CLOSE, titleWindow_close);
titleWindow.addChild(label);
PopUpManager.addPopUp(titleWindow, this, true);
PopUpManager.centerPopUp(titleWindow);
}
private function titleWindow_close(evt:CloseEvent):void {
PopUpManager.removePopUp(titleWindow);
}
]]>
</mx:Script>
<mx:Button label="Launch TitleWindow" click="init()" />
</mx:Application>
9:43 AM
|
Labels:
Flex Samples,
Pop up Control Samples
|
This entry was posted on 9:43 AM
and is filed under
Flex Samples
,
Pop up Control Samples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment