import mx.managers.PopUpManager
import mx.containers.TitleWindow;
import mx.controls.TextArea;
import mx.events.CloseEvent;
private var _window:TitleWindow;
private function showWindow(event:Event):void {
var textArea:TextArea = new TextArea( );
textArea.text = "this is a test";
textArea.height = 200;
_window = TitleWindow(PopUpManager.createPopUp(this, TitleWindow));
_window.addChild(textArea);
_window.showCloseButton = true;
_window.addEventListener(CloseEvent.CLOSE, closeHandler);
}
private function closeHandler(event:CloseEvent):void {
PopUpManager.removePopUp(_window);
}