<?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; closeButtonDownSkin</title>
	<atom:link href="http://blog.flexexamples.com/tag/closebuttondownskin/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>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>
	</channel>
</rss>

