<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; TitleWindow</title>
	<atom:link href="http://blog.flexexamples.com/category/titlewindow/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating an undraggable TitleWindow container in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 22:32:38 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[isPopUp]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/03/21/creating-an-undraggable-alert-control-in-flex/">&#8220;Creating an undraggable Alert control in Flex&#8221;</a>, we saw how you could create a Flex Alert control that isn&#8217;t draggable by listening for the mouseDown event and calling the stopImmediatePropagation() method in the event handler.</p> <p>The following examples show how you can create an undraggable TitleWindow container by setting the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/03/21/creating-an-undraggable-alert-control-in-flex/">&#8220;Creating an undraggable Alert control in Flex&#8221;</a>, we saw how you could create a Flex Alert control that isn&#8217;t draggable by listening for the <code>mouseDown</code> event and calling the <code>stopImmediatePropagation()</code> method in the event handler.</p>
<p>The following examples show how you can create an undraggable TitleWindow container by setting the <code>isPopUp</code> property to <code>false</code> on the TitleWindow instance.</p>
<p>Full code after the jump.</p>
<p><span id="more-748"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:Application name="PopUpManager_TitleWindow_isPopUp_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.TitleWindow;
            import mx.managers.PopUpManager;

            private var titleWin:MyTitleWin;

            private function launch():void {
                titleWin = PopUpManager.createPopUp(this, MyTitleWin, true) as MyTitleWin;
                PopUpManager.centerPopUp(titleWin);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Launch TitleWindow PopUp"
                click="launch();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/MyTitleWin.mxml.html">MyTitleWin.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        showCloseButton="true"
        title="TitleWindow"
        width="300"
        height="200"
        close="titleWin_close(event);"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            private function titleWin_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }

            private function checkBox_change(evt:Event):void {
                this.isPopUp = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label text="Drag this window"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

    &lt;mx:ControlBar&gt;
        &lt;mx:CheckBox id="checkBox"
                label="isPopUp:"
                labelPlacement="left"
                selected="true"
                change="checkBox_change(event);" /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:Application name="PopUpManager_TitleWindow_isPopUp_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ControlBar;
            import mx.controls.ButtonLabelPlacement;
            import mx.controls.CheckBox;
            import mx.containers.TitleWindow;
            import mx.controls.Label;
            import mx.core.ContainerLayout;
            import mx.events.CloseEvent;
            import mx.events.FlexEvent;
            import mx.managers.PopUpManager;

            private var checkBox:CheckBox;
            private var titleWin:TitleWindow;

            private function launch():void {
                var lbl:Label = new Label();
                lbl.text = "Drag this window";
                lbl.setStyle("horizontalCenter", 0);
                lbl.setStyle("verticalCenter", 0);

                checkBox = new CheckBox();
                checkBox.label = "isPopUp:";
                checkBox.labelPlacement = ButtonLabelPlacement.LEFT;
                checkBox.selected = true;
                checkBox.addEventListener(Event.CHANGE, checkBox_change);

                var controlBar:ControlBar = new ControlBar();
                controlBar.addChild(checkBox);

                titleWin = new TitleWindow();
                titleWin.layout = ContainerLayout.ABSOLUTE;
                titleWin.title = "TitleWindow";
                titleWin.showCloseButton = true;
                titleWin.width = 300;
                titleWin.height = 200;
                titleWin.addChild(lbl);
                titleWin.addChild(controlBar);
                titleWin.addEventListener(CloseEvent.CLOSE, titleWin_close);
                PopUpManager.addPopUp(titleWin, this, true);
                PopUpManager.centerPopUp(titleWin);
            }

            private function titleWin_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(titleWin);
            }

            private function checkBox_change(evt:Event):void {
                titleWin.isPopUp = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Launch TitleWindow PopUp"
                click="launch();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p>The following example shows how you can create a custom TitleWindow based component (NonDraggableTitleWindow.mxml) which sets the <code>isPopUp</code> property to <code>false</code> in the TitleWindow instance&#8217;s <code>initialize</code> event handler:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:Application name="PopUpManager_TitleWindow_isPopUp_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.PopUpManager;

            private var titleWin:NonDraggableTitleWindow;

            private function launch():void {
                titleWin = PopUpManager.createPopUp(this, NonDraggableTitleWindow, true) as NonDraggableTitleWindow;
                PopUpManager.centerPopUp(titleWin);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Launch TitleWindow PopUp"
                click="launch();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/NonDraggableTitleWindow.mxml.html">NonDraggableTitleWindow.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        showCloseButton="true"
        title="TitleWindow"
        width="300"
        height="200"
        initialize="titleWin_initialize(event);"
        close="titleWin_close(event);"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.FlexEvent;
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            private function titleWin_initialize(evt:FlexEvent):void {
                evt.target.isPopUp = false;
            }

            private function titleWin_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label text="Drag this window"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p>Finally, the following example shows how you can extend the TitleWindow class in ActionScript and set the <code>isPopUp</code> property to <code>false</code> in the TitleWindow instance&#8217;s <code>initialize</code> event handler.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/ --&gt;
&lt;mx:Application name="PopUpManager_TitleWindow_isPopUp_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.PopUpManager;

            private var titleWin:NonDraggableTitleWindow2;

            private function launch():void {
                titleWin = PopUpManager.createPopUp(this, NonDraggableTitleWindow2, true) as NonDraggableTitleWindow2;
                PopUpManager.centerPopUp(titleWin);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Launch TitleWindow PopUp"
                click="launch();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_TitleWindow_isPopUp_test/bin/srcview/source/NonDraggableTitleWindow2.as.html">NonDraggableTitleWindow2.as</a></p>
<pre class="code">
/**
 * http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/
 */
package {
    import mx.containers.TitleWindow;
    import mx.controls.Label;
    import mx.core.ContainerLayout;
    import mx.core.IFlexDisplayObject;
    import mx.events.CloseEvent;
    import mx.events.FlexEvent;
    import mx.managers.PopUpManager;

    public class NonDraggableTitleWindow2 extends TitleWindow {
        public var lbl:Label;

        public function NonDraggableTitleWindow2() {
            super();
            init();
        }

        private function init():void {
            this.layout = ContainerLayout.ABSOLUTE;
            this.title = "TitleWindow";
            this.showCloseButton = true;
            this.width = 300;
            this.height = 200;
            this.addEventListener(FlexEvent.INITIALIZE, titleWin_initialize);
            this.addEventListener(CloseEvent.CLOSE, titleWin_close);

            lbl = new Label();
            lbl.text = "Drag this Window";
            lbl.setStyle("horizontalCenter", 0);
            lbl.setStyle("verticalCenter", 0);
            addChild(lbl);
        }

        private function titleWin_initialize(evt:FlexEvent):void {
            this.isPopUp = false;
        }

        private function titleWin_close(evt:CloseEvent):void {
            PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
        }
    }
}
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating an undraggable TitleWindow container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/',contentID: 'post-748',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'isPopUp',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/16/creating-an-undraggable-titlewindow-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Displaying a video in a pop up window in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 15:14:31 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[VideoDisplay]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use the PopUpManager class to display a VideoDisplay control in a TitleWindow container in Flex.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.managers.PopUpManager; private function button_click(evt:MouseEvent):void { var popUpVideoDisplay:PopUpVideoDisplay; popUpVideoDisplay = [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the PopUpManager class to display a VideoDisplay control in a TitleWindow container in Flex.</p>
<p>Full code after the jump.</p>
<p><span id="more-730"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.PopUpManager;

            private function button_click(evt:MouseEvent):void {
                var popUpVideoDisplay:PopUpVideoDisplay;
                popUpVideoDisplay = new PopUpVideoDisplay();
                popUpVideoDisplay.source = "http://www.helpexamples.com/flash/video/water.flv";
                PopUpManager.addPopUp(popUpVideoDisplay, this, true);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button id="button"
            label="Launch video"
            click="button_click(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/PopUpVideoDisplay.mxml.html">PopUpVideoDisplay.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        showCloseButton="true"
        styleName="noPadding"
        creationComplete="init();"
        close="titleWindow_close(event);"&gt;

    &lt;mx:Style&gt;
        .noPadding {
            paddingBottom: 0;
            paddingTop: 0;
            paddingLeft: 0;
            paddingRight: 0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.IFocusManagerComponent;
            import mx.controls.Alert;
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            [Bindable]
            public var source:String;

            private function init():void {
                PopUpManager.centerPopUp(this);
            }

            private function titleWindow_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="{source}"
            resize="init();" /&gt;

    &lt;mx:ControlBar horizontalAlign="right" width="100%"&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/main.html" width="100%" height="350"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a video in a pop up window in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/',contentID: 'post-730',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Creating a pop up TitleWindow using the PopUpButton control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 05:49:42 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[ToolBar]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can create a pop up TitleWindow container using the Flex PopUpButton control.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; TitleWindow { roundedBottomCorners: false; borderColor: haloSilver; backgroundColor: haloSilver; borderAlpha: 0.8; backgroundAlpha: 0.8; dropShadowEnabled: false; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a pop up TitleWindow container using the Flex PopUpButton control.</p>
<p>Full code after the jump.</p>
<p><span id="more-584"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        TitleWindow {
            roundedBottomCorners: false;
            borderColor: haloSilver;
            backgroundColor: haloSilver;
            borderAlpha: 0.8;
            backgroundAlpha: 0.8;
            dropShadowEnabled: false;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.CheckBox;
            import mx.controls.dataGridClasses.DataGridColumn;

            private function checkBox_change(evt:Event):void {
                var ch:CheckBox = evt.currentTarget as CheckBox;
                var idx:int = int(ch.data);
                var obj:Object = arrColl.getItemAt(idx);
                obj.sel = ch.selected;
                arrColl.disableAutoUpdate();
                arrColl.setItemAt(obj, idx);
            }

            private function selectAll(evt:Event):void {
                var idx:int;
                var item:Object;
                for (idx=0; idx&lt;arrColl.length; idx++) {
                    item = arrColl.getItemAt(idx);
                    item.sel = CheckBox(evt.currentTarget).selected;
                }
                arrColl.refresh();
            }

            private function sel_labelFunc(item:Object, col:DataGridColumn):String {
                var bool:Boolean = item.hasOwnProperty("sel") &#038;&#038;
                            (item.sel == "true" || item.sel == true);
                return bool.toString();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array id="arr"&gt;
                &lt;mx:Object label="Button" /&gt;
                &lt;mx:Object label="ButtonBar" /&gt;
                &lt;mx:Object label="CheckBox" /&gt;
                &lt;mx:Object label="ColorPicker" sel="true" /&gt;
                &lt;mx:Object label="ComboBox" sel="true" /&gt;
                &lt;mx:Object label="DataGrid" sel="true" /&gt;
                &lt;mx:Object label="DateChooser" /&gt;
                &lt;mx:Object label="DateField" sel="true" /&gt;
                &lt;mx:Object label="HorizontalList" /&gt;
                &lt;mx:Object label="HRule" /&gt;
                &lt;mx:Object label="HSlider" /&gt;
                &lt;mx:Object label="Image" /&gt;
                &lt;mx:Object label="Label" /&gt;
                &lt;mx:Object label="LinkBar" /&gt;
                &lt;mx:Object label="LinkButton" /&gt;
                &lt;mx:Object label="List" sel="true" /&gt;
                &lt;mx:Object label="Menu" /&gt;
                &lt;mx:Object label="MenuBar" /&gt;
                &lt;mx:Object label="NumericStepper" sel="true" /&gt;
                &lt;mx:Object label="ProgressBar" /&gt;
                &lt;mx:Object label="RadioButton" /&gt;
                &lt;mx:Object label="RadioButtonGroup" /&gt;
                &lt;mx:Object label="RichTextEditor" sel="true" /&gt;
                &lt;mx:Object label="Spacer" /&gt;
                &lt;mx:Object label="SWFLoader" /&gt;
                &lt;mx:Object label="TabBar" /&gt;
                &lt;mx:Object label="Text" /&gt;
                &lt;mx:Object label="TextArea" /&gt;
                &lt;mx:Object label="TextInput" /&gt;
                &lt;mx:Object label="TileList" /&gt;
                &lt;mx:Object label="Tree" sel="true" /&gt;
                &lt;mx:Object label="VideoDisplay" /&gt;
                &lt;mx:Object label="VRule" /&gt;
                &lt;mx:Object label="VScrollBar" /&gt;
                &lt;mx:Object label="VSlider" /&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:PopUpButton id="popUpButton"
                label="Please select some components"
                openAlways="true"
                close="arrColl.refresh();"&gt;
            &lt;mx:popUp&gt;
                &lt;mx:TitleWindow id="titleWin"
                        height="200"
                        showCloseButton="true"
                        verticalScrollPolicy="on"
                        horizontalScrollPolicy="off"
                        close="popUpButton.close();"&gt;
                    &lt;mx:ToolBar width="320"&gt;
                        &lt;mx:Repeater id="myRep"
                                dataProvider="{arrColl}"&gt;
                            &lt;mx:CheckBox data="{myRep.currentIndex}"
                                    label="{myRep.currentItem.label}"
                                    selected="{myRep.currentItem.sel}"
                                    change="checkBox_change(event);"
                                    width="100" /&gt;
                        &lt;/mx:Repeater&gt;
                    &lt;/mx:ToolBar&gt;
                    &lt;mx:ControlBar&gt;
                        &lt;mx:CheckBox label="Select All"
                                labelPlacement="left"
                                change="selectAll(event);" /&gt;
                    &lt;/mx:ControlBar&gt;
                &lt;/mx:TitleWindow&gt;
            &lt;/mx:popUp&gt;
        &lt;/mx:PopUpButton&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid dataProvider="{arrColl}"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="label" /&gt;
            &lt;mx:DataGridColumn dataField="sel"
                    labelFunction="sel_labelFunc" /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a pop up TitleWindow using the PopUpButton control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/',contentID: 'post-584',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Setting the header height on a Flex TitleWindow container</title>
		<link>http://blog.flexexamples.com/2008/03/25/setting-the-header-height-on-a-flex-titlewindow-container/</link>
		<comments>http://blog.flexexamples.com/2008/03/25/setting-the-header-height-on-a-flex-titlewindow-container/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 06:50:16 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[headerHeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/25/setting-the-header-height-on-a-flex-titlewindow-container/</guid>
		<description><![CDATA[<p>The following example shows you how you can change the header height on a TitleWindow container in Flex by setting the headerHeight style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="headerHeight:"&#62; &#60;mx:HSlider id="slider" minimum="24" maximum="64" value="32" snapInterval="2" tickInterval="4" liveDragging="true" /&#62; &#60;/mx:FormItem&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can change the header height on a TitleWindow container in Flex by setting the <code>headerHeight</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-570"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!--  --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="headerHeight:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="24"
                        maximum="64"
                        value="32"
                        snapInterval="2"
                        tickInterval="4"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TitleWindow id="titleWindow"
            title="The quick brown fox jumped"
            status="{titleWindow.width}x{titleWindow.height}"
            titleIcon="@Embed('assets/TitleWindow.png')"
            showCloseButton="true"
            headerHeight="{slider.value}"
            borderColor="haloBlue"
            borderAlpha="1.0"
            width="400"
            height="150"&gt;
        &lt;mx:VBox id="vBox" width="100%" height="100%"&gt;
            &lt;mx:Label text="{vBox.width}x{vBox.height}" /&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:TitleWindow&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the header height on a Flex TitleWindow container on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/25/setting-the-header-height-on-a-flex-titlewindow-container/',contentID: 'post-570',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'headerHeight',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/03/25/setting-the-header-height-on-a-flex-titlewindow-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing a TitleWindow container&#8217;s internal close button in Flex</title>
		<link>http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 06:55:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[closeButton]]></category>
		<category><![CDATA[mx internal]]></category>
		<category><![CDATA[showCloseButton]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can access the close button in a Flex TitleWindow container by using the closeButton property in the mx_internal namespace.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">Since this example uses the mx_internal namespace, you can’t always depend on this behavior to work in future versions of the Flex SDK. [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can access the close button in a Flex TitleWindow container by using the <code>closeButton</code> property in the <code>mx_internal</code> namespace.</p>
<p>Full code after the jump.</p>
<p><span id="more-573"></span></p>
<p class="alert">Since this example uses the <code>mx_internal</code> namespace, you can’t always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButton_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.CloseEvent;
            import mx.controls.Button;

            private function checkBox_change(evt:Event):void {
                var btn:Button = titleWindow.mx_internal::closeButton;
                btn.enabled = checkBox.selected;
            }

            private function titleWindow_close(evt:CloseEvent):void {
                arrColl.addItem({type:evt.type, time:getTimer()});
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arrColl" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="closeButton enabled:"
                selected="true"
                change="checkBox_change(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TitleWindow id="titleWindow"
            showCloseButton="true"
            width="100%"
            close="titleWindow_close(event);"&gt;
        &lt;mx:DataGrid id="dataGrid"
                dataProvider="{arrColl}"
                width="100%"
                rowCount="6"&gt;
            &lt;mx:columns&gt;
                &lt;mx:DataGridColumn dataField="type" /&gt;
                &lt;mx:DataGridColumn dataField="time" /&gt;
            &lt;/mx:columns&gt;
        &lt;/mx:DataGrid&gt;
    &lt;/mx:TitleWindow&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButton_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButton_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Accessing a TitleWindow container\&#039;s internal close button in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/',contentID: 'post-573',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'closeButton,mx internal,showCloseButton',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/03/24/accessing-a-titlewindow-containers-internal-close-button-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating custom pop-up windows with the PopUpManager class (redux)</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/</link>
		<comments>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 01:35:37 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[centerPopUp()]]></category>
		<category><![CDATA[close()]]></category>
		<category><![CDATA[createPopUp()]]></category>
		<category><![CDATA[showCloseButton]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/08/06/creating-custom-pop-up-windows-with-the-popupmanager-class/">&#8220;Creating custom pop-up windows with the PopUpManager class&#8221;</a>, we saw how you could use ActionScript to create pop up windows using the PopUpManager class in Flex.</p> <p>In the following example we see how you can create a custom MXML component and pass the class name to the static PopUpManager.createPopUp() method [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/08/06/creating-custom-pop-up-windows-with-the-popupmanager-class/">&#8220;Creating custom pop-up windows with the PopUpManager class&#8221;</a>, we saw how you could use ActionScript to create pop up windows using the PopUpManager class in Flex.</p>
<p>In the following example we see how you can create a custom MXML component and pass the class name to the static <code>PopUpManager.createPopUp()</code> method to display the pop up.</p>
<p>Full code after the jump.</p>
<p><span id="more-568"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_createPopUp_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.PopUpManager;

            private function launchMoreInfo():void {
                var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
                PopUpManager.centerPopUp(win);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="button"
                label="Click for more information"
                click="launchMoreInfo();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_createPopUp_test/bin/srcview/source/Dialog.mxml.html">Dialog.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- Dialog.mxml --&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        title="More information"
        showCloseButton="true"
        width="400"
        height="300"
        close="titleWindow_close(event);"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            private function titleWindow_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(this);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:String id="info" source="info.txt" /&gt;

    &lt;mx:TextArea id="txt"
            htmlText="{info}"
            focusAlpha="0.0"
            width="100%"
            height="100%" /&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p class="download">info.txt</p>
<pre class="code">
&lt;font size="+2"&gt;&lt;i&gt;More Information...&lt;/i&gt;&lt;/font&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec at arcu in lacus iaculis ultricies. Vivamus consectetuer. Donec vulputate aliquam leo. Nam metus. Aliquam nulla odio, ultrices vitae, nonummy eget, viverra accumsan, tellus. Curabitur neque ante, nonummy ut, fermentum eu, elementum a, ligula. Fusce hendrerit lectus ac velit. Suspendisse lorem pede, sagittis ac, fermentum non, auctor quis, nulla. Integer eu lacus sit amet justo vestibulum sodales. In euismod tellus eget magna. Vestibulum sed ante. Suspendisse eros libero, gravida ac, cursus et, porta vitae, lectus.&lt;/p&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_createPopUp_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_createPopUp_test/bin/main.html" width="100%" height="400"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating custom pop-up windows with the PopUpManager class (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/',contentID: 'post-568',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'centerPopUp(),close(),createPopUp(),showCloseButton',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Changing the close button skin on a Flex TitleWindow container</title>
		<link>http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/</link>
		<comments>http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 04:38:25 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[closeButtonDisabledSkin]]></category>
		<category><![CDATA[closeButtonDownSkin]]></category>
		<category><![CDATA[closeButtonOverSkin]]></category>
		<category><![CDATA[closeButtonSkin]]></category>
		<category><![CDATA[closeButtonUpSkin]]></category>
		<category><![CDATA[showCloseButton]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/</guid>
		<description><![CDATA[<p>The following example shows how you can change the appearance of the close button in a TitleWindow container in Flex by setting the closeButtonSkin style (or the closeButtonUpSkin, closeButtonOverSkin, closeButtonDownSkin, closeButtonDisabledSkin styles individually).</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the appearance of the close button in a TitleWindow container in Flex by setting the <code>closeButtonSkin</code> style (or the <code>closeButtonUpSkin</code>, <code>closeButtonOverSkin</code>, <code>closeButtonDownSkin</code>, <code>closeButtonDisabledSkin</code> styles individually).</p>
<p>Full code after the jump.</p>
<p><span id="more-403"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        TitleWindow {
            closeButtonSkin: Embed("cancel.png");
            /* Set values from defaults.css to null. */
            closeButtonDisabledSkin: ClassReference(null);
            closeButtonDownSkin: ClassReference(null);
            closeButtonOverSkin: ClassReference(null);
            closeButtonUpSkin: ClassReference(null);
        }
    &lt;/mx:Style&gt;

    &lt;mx:TitleWindow id="titleWindow"
            title="TitleWindow"
            status="status message"
            showCloseButton="true"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>If you want to use a different image for each state (up, over, down, disabled), you can either set each skin separately, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    TitleWindow {
        closeButtonUpSkin: Embed("bullet_green.png");
        closeButtonOverSkin: Embed("bullet_yellow.png");
        closeButtonDownSkin: Embed("bullet_red.png");
        closeButtonDisabledSkin: Embed("bullet_white.png");
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you can specify a SWF file and symbol name for the close button skins, as seen in the following snippet:</p>
<pre class="code">
TitleWindow {
    closeButtonDisabledSkin: Embed(source="Assets.swf", symbol="CloseButtonDisabled");
    closeButtonDownSkin: Embed(source="Assets.swf", symbol="CloseButtonDown");
    closeButtonOverSkin: Embed(source="Assets.swf", symbol="CloseButtonOver");
    closeButtonUpSkin: Embed(source="Assets.swf", symbol="CloseButtonUp");
}
</pre>
<p>Or, you can create a Flex Componet skin using the Flex Component Kit and Flash CS3 where the movie clip symbol in the library has the following frame labels: up, over, down, disabled, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        TitleWindow {
            closeButtonSkin: Embed(skinClass="BulletSkins");
            /* Set values from defaults.css to null. */
            closeButtonDisabledSkin: ClassReference(null);
            closeButtonDownSkin: ClassReference(null);
            closeButtonOverSkin: ClassReference(null);
            closeButtonUpSkin: ClassReference(null);
        }
    &lt;/mx:Style&gt;

    &lt;mx:TitleWindow id="titleWindow"
            title="TitleWindow"
            status="status message"
            showCloseButton="true"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_closeButtonSkin_test_2/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the close button skin on a Flex TitleWindow container on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/',contentID: 'post-403',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'closeButtonDisabledSkin,closeButtonDownSkin,closeButtonOverSkin,closeButtonSkin,closeButtonUpSkin,showCloseButton',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/12/31/changing-the-close-button-skin-on-a-flex-titlewindow-container/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Toggling the close button in a Flex TitleWindow container</title>
		<link>http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/</link>
		<comments>http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 02:55:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[showCloseButton]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/</guid>
		<description><![CDATA[<p>The following example shows you how you can toggle the close button in a TitleWindow container in Flex by setting the showCloseButton property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_showCloseButton_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:TitleWindow id="titleWindow1" showCloseButton="true" title="TitleWindow" status="showCloseButton = true" width="50%" height="100%" /&#62; &#60;mx:TitleWindow [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can toggle the close button in a TitleWindow container in Flex by setting the <code>showCloseButton</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-402"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_showCloseButton_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:TitleWindow id="titleWindow1"
            showCloseButton="true"
            title="TitleWindow"
            status="showCloseButton = true"
            width="50%"
            height="100%" /&gt;

    &lt;mx:TitleWindow id="titleWindow2"
            showCloseButton="false"
            title="TitleWindow"
            status="showCloseButton = false"
            width="50%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_showCloseButton_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_showCloseButton_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Toggling the close button in a Flex TitleWindow container on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/',contentID: 'post-402',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'showCloseButton',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/12/31/toggling-the-close-button-in-a-flex-titlewindow-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling the TitleWindow container</title>
		<link>http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/</link>
		<comments>http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 03:47:28 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[.windowStatus]]></category>
		<category><![CDATA[.windowStyles]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[title]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the Flex TitleWindow container by setting the &#8220;.windowStyles&#8221; style, &#8220;.windowStatus&#8221; style, and TitleWindow style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_style_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; /* Style the Window title message. */ .windowStyles { color: haloBlue; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the Flex TitleWindow container by setting the &#8220;.windowStyles&#8221; style, &#8220;.windowStatus&#8221; style, and TitleWindow style.</p>
<p>Full code after the jump.</p>
<p><span id="more-166"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_style_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        /* Style the Window title message. */
        .windowStyles {
            color: haloBlue;
            letterSpacing: 2;
        }

        /* Style the Window status message. */
        .windowStatus {
            color: red;
            fontWeight: bold;
        }

        TitleWindow {
            dropShadowEnabled: false;
            borderAlpha: 1.0;
            borderColor: haloSilver;
            backgroundColor: haloSilver;
            cornerRadius: 0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:TitleWindow id="titleWindow"
            title="Title"
            status="Status"
            width="160"&gt;
        &lt;mx:Text htmlText="The quick brown fox jumped over the lazy dog."
                selectable="false"
                width="100%" /&gt;
        &lt;mx:ControlBar horizontalAlign="right"&gt;
            &lt;mx:Button label="Button" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:TitleWindow&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_style_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_style_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the TitleWindow container on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/',contentID: 'post-166',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '.windowStatus,.windowStyles,status,title',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/10/styling-the-titlewindow-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the TitleWindow container to display status messages</title>
		<link>http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/</link>
		<comments>http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 06:10:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[displayAsPassword]]></category>
		<category><![CDATA[showCloseButton]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/</guid>
		<description><![CDATA[<p>Another example of something I&#8217;ve seen lately on the Internet, so I thought I&#8217;d build it in Flex. This time I usea TitleWindow to display the status message of a login form. You can close the message by clicking the X button in the upper-right corner of the title window.</p> <p>Note that there is no [...]]]></description>
			<content:encoded><![CDATA[<p>Another example of something I&#8217;ve seen lately on the Internet, so I thought I&#8217;d build it in Flex. This time I usea TitleWindow to display the status message of a login form. You can close the message by clicking the X button in the upper-right corner of the title window.</p>
<p>Note that there is no correct login. It will display the error message every time. In a future example I&#8217;ll try and add some fancy fade in/out effects or resize effects on the error message to give it that proper &#8220;Web 2.0 feel&#8221;.</p>
<p>Full code after the jump.</p>
<p><span id="more-109"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_height_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        TitleWindow {
            cornerRadius: 0;
            backgroundColor: red;
            borderColor: red;
            borderAlpha: 1.0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function showTitleWindow():void {
                titleWindow.height = 28;
            }

            private function hideTitleWindow():void {
                titleWindow.height = 0;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VBox&gt;
        &lt;mx:TitleWindow id="titleWindow"
                title="Invalid username and/or password."
                showCloseButton="true"
                width="100%"
                height="0"
                close="hideTitleWindow()" /&gt;

        &lt;mx:Form&gt;
            &lt;mx:FormItem label="Username:"&gt;
                &lt;mx:TextInput id="username"
                        maxChars="24" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="Password:"&gt;
                &lt;mx:TextInput id="password"
                        maxChars="24"
                        displayAsPassword="true" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem&gt;
                &lt;mx:Button label="Login"
                        click="showTitleWindow()" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_height_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TitleWindow_height_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using the TitleWindow container to display status messages on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/',contentID: 'post-109',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayAsPassword,showCloseButton',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/22/using-the-titlewindow-container-to-display-status-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

