<?xml version="1.0"?>
<!-- Main application to demonstrate Halo TitleWindow layout container. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="500" height="350" backgroundColor="#F3F3F0">
<fx:Script>
<![CDATA[
import flash.events.Event;
import mx.core.IFlexDisplayObject;
import mx.managers.PopUpManager;
import spark.components.TitleWindow;
private function showWindow():void {
var videoWin:CustomTitleWin = CustomTitleWin(PopUpManager.createPopUp(this, CustomTitleWin , true));
videoWin.x=(stage.stageWidth-videoWin.width)/2;
videoWin.y=(stage.stageHeight-videoWin.height)/2;
videoWin.addEventListener("close", closeHandler);
}
private function closeHandler(event:Event):void {
event.target.removeEventListener("close", closeHandler);
PopUpManager.removePopUp(event.target as IFlexDisplayObject);
}
]]>
</fx:Script>
<s:Button id="myButton" label="Play Video" click="showWindow();" horizontalCenter="0" verticalCenter="0"/>
</s:Application>