<?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; styleName</title>
	<atom:link href="http://blog.flexexamples.com/tag/stylename/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>Setting a custom icon on the MX Button control in Flex</title>
		<link>http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 20:27:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[disabledIcon]]></category>
		<category><![CDATA[disabledSkin]]></category>
		<category><![CDATA[downIcon]]></category>
		<category><![CDATA[downSkin]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[overIcon]]></category>
		<category><![CDATA[overSkin]]></category>
		<category><![CDATA[styleName]]></category>
		<category><![CDATA[upIcon]]></category>
		<category><![CDATA[upSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3427</guid>
		<description><![CDATA[<p>The following example shows how you can use the MX TitleWindow container&#8217;s close button for an MX Button control icon and skin by setting the skinClass style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/ --&#62; &#60;mx:Application name=&#34;MX_Button_upIcon_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Style&#62; .titleWindowIconAsIcon { upIcon: Embed(&#34;Assets.swf#CloseButtonUp&#34;); overIcon: Embed(&#34;Assets.swf#CloseButtonOver&#34;); downIcon: Embed(&#34;Assets.swf#CloseButtonDown&#34;); disabledIcon: Embed(&#34;Assets.swf#CloseButtonDisabled&#34;); } &#160; .titleWindowIconAsSkin [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the MX TitleWindow container&#8217;s close button for an MX Button control icon and skin by setting the <code>skinClass</code> style.</p>
<p><span id="more-3427"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_Button_upIcon_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .titleWindowIconAsIcon {
            upIcon: Embed(&quot;Assets.swf#CloseButtonUp&quot;);
            overIcon: Embed(&quot;Assets.swf#CloseButtonOver&quot;);
            downIcon: Embed(&quot;Assets.swf#CloseButtonDown&quot;);
            disabledIcon: Embed(&quot;Assets.swf#CloseButtonDisabled&quot;);
        }
&nbsp;
        .titleWindowIconAsSkin {
            upSkin: Embed(&quot;Assets.swf#CloseButtonUp&quot;);
            overSkin: Embed(&quot;Assets.swf#CloseButtonOver&quot;);
            downSkin: Embed(&quot;Assets.swf#CloseButtonDown&quot;);
            disabledSkin: Embed(&quot;Assets.swf#CloseButtonDisabled&quot;);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> styleName=<span style="color: #ff0000;">&quot;titleWindowIconAsIcon&quot;</span> label=<span style="color: #ff0000;">&quot;Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> styleName=<span style="color: #ff0000;">&quot;titleWindowIconAsSkin&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a custom icon on the MX Button control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/',contentID: 'post-3427',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'disabledIcon,disabledSkin,downIcon,downSkin,icon,overIcon,overSkin,styleName,upIcon,upSkin',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/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting multiple style names on a Spark Button control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 16:59:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Button (Spark)]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3410</guid>
		<description><![CDATA[<p>The following example shows how you can define multiple style names on a Spark Button control in Flex 4 by setting the styleName property to a space separated list of CSS style names.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_Button_styleName_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#60;s:layout&#62; &#60;s:HorizontalLayout horizontalAlign=&#34;center&#34; verticalAlign=&#34;middle&#34; /&#62; &#60;/s:layout&#62; &#160; &#60;fx:Style&#62; .boldWeight { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can define multiple style names on a Spark Button control in Flex 4 by setting the <code>styleName</code> property to a space separated list of CSS style names.</p>
<p><span id="more-3410"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Button_styleName_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .boldWeight {
            fontWeight: bold;
        }
        .redColor {
            color: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn1&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;MXML&quot;</span></span>
<span style="color: #000000;">            styleName=<span style="color: #ff0000;">&quot;redColor boldWeight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn2&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;ActionScript (click)&quot;</span></span>
<span style="color: #000000;">            toolTip=<span style="color: #ff0000;">&quot;Click to apply styles&quot;</span></span>
<span style="color: #000000;">            click=<span style="color: #ff0000;">&quot;btn2.styleName = 'redColor boldWeight';&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting multiple style names on a Spark Button control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/',contentID: 'post-3410',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'styleName',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/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Applying styles to specific Spark List controls in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 15:21:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2172</guid>
		<description><![CDATA[<p>The following example shows how you can selectively style Spark List controls in Flex 4 using Advanced CSS and the styleName property or the id property.</p> <p>Full code after the jump.</p> <p></p> <p>1) The following example uses s&#124;List selector and applies the baseColor style to ALL Spark List component instances in your Flex application:</p> &#60;?xml [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can selectively style Spark List controls in Flex 4 using Advanced CSS and the <code>styleName</code> property or the <code>id</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-2172"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>
<p>1) The following example uses s|List selector and applies the <code>baseColor</code> style to <em>ALL</em> Spark List component instances in your Flex application:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_List_HScrollBar_styles_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|List {
            baseColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> id=<span style="color: #ff0000;">&quot;arrList&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list1&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list2&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list3&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>2) The following example uses s|List selector and applies the <code>baseColor</code> style to any Spark List component instances which have a <code>styleName</code> property of &#8220;listHSBStyles&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_List_HScrollBar_styles_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|List.listHSBStyles {
            baseColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> id=<span style="color: #ff0000;">&quot;arrList&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list1&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list2&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;listHSBStyles&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list3&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;listHSBStyles&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>3) The following example uses s|List selector and applies the <code>baseColor</code> style to any Spark List component instances which have an <code>id</code> property of &#8220;list1&#8243;:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_List_HScrollBar_styles_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|List#list1 {
            baseColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> id=<span style="color: #ff0000;">&quot;arrList&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list1&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list2&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list3&quot;</span></span>
<span style="color: #000000;">                dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Applying styles to specific Spark List controls in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/',contentID: 'post-2172',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,id,styleName',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/2009/11/05/applying-styles-to-specific-spark-list-controls-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying an icon on a toggle button in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 03:55:47 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[Button (Spark)]]></category>
		<category><![CDATA[ButtonBar (Spark)]]></category>
		<category><![CDATA[BitmapImage]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[skinClass]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1278</guid>
		<description><![CDATA[<p>The following example shows how you can create a simple toggle button with an icon in Flex 4 by using the Spark ButtonBarButton control and specifying the icon in the data property, and then using a custom skin class.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_ButtonBarButton_data_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a simple toggle button with an icon in Flex 4 by using the Spark ButtonBarButton control and specifying the icon in the <code>data</code> property, and then using a custom skin class.</p>
<p>Full code after the jump.</p>
<p><span id="more-1278"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_ButtonBarButton_data_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|ButtonBarButton.iconButton {
            skinClass: ClassReference(&quot;skins.CustomIconButtonSkin&quot;);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBarButton</span> id=<span style="color: #ff0000;">&quot;redBtn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Red&quot;</span></span>
<span style="color: #000000;">                data=<span style="color: #ff0000;">&quot;@Embed('assets/bullet_red.png')&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;iconButton&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBarButton</span> id=<span style="color: #ff0000;">&quot;orangeBtn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Orange&quot;</span></span>
<span style="color: #000000;">                data=<span style="color: #ff0000;">&quot;@Embed('assets/bullet_orange.png')&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;iconButton&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBarButton</span> id=<span style="color: #ff0000;">&quot;yelloyBtn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Yellow&quot;</span></span>
<span style="color: #000000;">                data=<span style="color: #ff0000;">&quot;@Embed('assets/bullet_yellow.png')&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;iconButton&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBarButton</span> id=<span style="color: #ff0000;">&quot;greenBtn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Green&quot;</span></span>
<span style="color: #000000;">                data=<span style="color: #ff0000;">&quot;@Embed('assets/bullet_green.png')&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;iconButton&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBarButton</span> id=<span style="color: #ff0000;">&quot;blueBtn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Blue&quot;</span></span>
<span style="color: #000000;">                data=<span style="color: #ff0000;">&quot;@Embed('assets/bullet_blue.png')&quot;</span></span>
<span style="color: #000000;">                styleName=<span style="color: #ff0000;">&quot;iconButton&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And the custom skin class, skins/CustomIconButtonSkin.mxml, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomIconButtonSkin&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">        minWidth=<span style="color: #ff0000;">&quot;21&quot;</span> minHeight=<span style="color: #ff0000;">&quot;21&quot;</span></span>
<span style="color: #000000;">        alpha.disabledStates=<span style="color: #ff0000;">&quot;0.5&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- states --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;over&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;overStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;down&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;downStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabled&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;disabledStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;upAndSelected&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;selectedStates, selectedUpStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;overAndSelected&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;overStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;downAndSelected&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;downStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabledAndSelected&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;selectedUpStates, disabledStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- host component --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span> </span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>HostComponent<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.ButtonBarButton&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        /* Define the skin elements that should not be colorized. 
        For toggle button, the graphics are colorized but the label is not. */
        static private const exclusions:Array = [&quot;labelDisplay&quot;];
&nbsp;
        override public function get colorizeExclusions():Array {return exclusions;}
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: shadow --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;-1&quot;</span> right=<span style="color: #ff0000;">&quot;-1&quot;</span> top=<span style="color: #ff0000;">&quot;-1&quot;</span> bottom=<span style="color: #ff0000;">&quot;-1&quot;</span></span>
<span style="color: #000000;">            radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> </span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.01&quot;</span></span>
<span style="color: #000000;">                        alpha.downStates=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> </span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> </span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span></span>
<span style="color: #000000;">                        alpha.downStates=<span style="color: #ff0000;">&quot;0.5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> </span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;0xBBBDBD&quot;</span></span>
<span style="color: #000000;">                        color.overStates=<span style="color: #ff0000;">&quot;0xBBBDBD&quot;</span> </span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0xAAAAAA&quot;</span> </span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span> </span>
<span style="color: #000000;">                        alpha.overAndSelected=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD8D8D8&quot;</span> </span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;0x9FA0A1&quot;</span></span>
<span style="color: #000000;">                        color.over=<span style="color: #ff0000;">&quot;0x9FA0A1&quot;</span> </span>
<span style="color: #000000;">                        color.overAndSelected=<span style="color: #ff0000;">&quot;0x8E8F90&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0x929496&quot;</span> </span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.overAndSelected=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: fill lowlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;9&quot;</span></span>
<span style="color: #000000;">            radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0099&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0627&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 4: fill highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;9&quot;</span></span>
<span style="color: #000000;">            radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> </span>
<span style="color: #000000;">                    alpha=<span style="color: #ff0000;">&quot;0.33&quot;</span> </span>
<span style="color: #000000;">                    alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.22&quot;</span></span>
<span style="color: #000000;">                    alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> </span>
<span style="color: #000000;">                    alpha.downStates=<span style="color: #ff0000;">&quot;0.12&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 5: highlight stroke (all states except down) --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span></span>
<span style="color: #000000;">            excludeFrom=<span style="color: #ff0000;">&quot;downStates&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span></span>
<span style="color: #000000;">                        alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.33&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD8D8D8&quot;</span></span>
<span style="color: #000000;">                        alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.33&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: highlight stroke (down state only) --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> width=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, overAndSelected&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> width=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, overAndSelected&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;2&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;2&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, overAndSelected&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.25&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, overAndSelected&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.09&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> radiusY=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.5625&quot;</span></span>
<span style="color: #000000;">                        alpha.down=<span style="color: #ff0000;">&quot;0.6375&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedStates=<span style="color: #ff0000;">&quot;0.6375&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> </span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.75&quot;</span></span>
<span style="color: #000000;">                        alpha.down=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedStates=<span style="color: #ff0000;">&quot;0.85&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;10&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> bottom=<span style="color: #ff0000;">&quot;2&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;img.source = hostComponent.data;&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 8: icon --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> id=<span style="color: #ff0000;">&quot;img&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 9: text --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;labelDisplay&quot;</span></span>
<span style="color: #000000;">                textAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">                verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">                maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_ButtonBarButton_data_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_ButtonBarButton_data_test/bin/main.html" width="100%" height="100"></iframe></p>
<p class="alert">Icons copyright of <a href="http://www.famfamfam.com/lab/icons/">famfamfam.com</a>.</p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying an icon on a toggle button in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/',contentID: 'post-1278',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'BitmapImage,data,Gumbo,icon,skinClass,styleName',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/2009/07/28/displaying-an-icon-on-a-toggle-button-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting the label color on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:05:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[styleName]]></category>
		<category><![CDATA[textRollOverColor]]></category>
		<category><![CDATA[textSelectedColor]]></category>
		<category><![CDATA[themeColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application name="CheckBox_color_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; CheckBox { fontWeight: bold; iconColor: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p>
<p>Full code after the jump.</p>
<p><span id="more-943"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_color_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            fontWeight: bold;
            iconColor: green;
        }

        .selectedStyle {
            color: green;
            textRollOverColor: green;
            textSelectedColor: green;
            themeColor: green;
        }

        .unselectedStyle {
            color: red;
            textRollOverColor: red;
            textSelectedColor: red;
            themeColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                var tgt:CheckBox = evt.currentTarget as CheckBox;
                if (tgt.selected) {
                    tgt.styleName = "selectedStyle";
                } else {
                    tgt.styleName = "unselectedStyle";
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox"
            selected="false"
            styleName="unselectedStyle"
            change="checkBox_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the label color on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/',contentID: 'post-943',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'styleName,textRollOverColor,textSelectedColor,themeColor',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/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing the RichTextEditor control&#8217;s style name in Flex</title>
		<link>http://blog.flexexamples.com/2007/12/31/changing-the-richtexteditor-controls-style-name-in-flex/</link>
		<comments>http://blog.flexexamples.com/2007/12/31/changing-the-richtexteditor-controls-style-name-in-flex/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 02:31:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[RichTextEditor]]></category>
		<category><![CDATA[opaquePanel]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/31/changing-the-richtexteditor-controls-style-name-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can change the style name for the Flex RichTextEditor control to the predefined &#8220;.opaquePanel&#8221; style, by setting the styleName property on the RichTextEditor.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_styleName_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-richtexteditor-controls-style-name-in-flex/ --&#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:ToggleButtonBar selectedIndex="1" itemClick="richTextEditor.styleName [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the style name for the Flex RichTextEditor control to the predefined &#8220;.opaquePanel&#8221; style, by setting the <code>styleName</code> property on the RichTextEditor.</p>
<p>Full code after the jump.</p>
<p><span id="more-401"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_styleName_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-richtexteditor-controls-style-name-in-flex/ --&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:ToggleButtonBar selectedIndex="1"
                itemClick="richTextEditor.styleName = event.item.data;"&gt;
            &lt;mx:dataProvider&gt;
                &lt;mx:Array&gt;
                    &lt;mx:Object label="default" data="" /&gt;
                    &lt;mx:Object label="opaquePanel" data="opaquePanel" /&gt;
                &lt;/mx:Array&gt;
            &lt;/mx:dataProvider&gt;
        &lt;/mx:ToggleButtonBar&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:RichTextEditor id="richTextEditor"
            title="RichTextEditor"
            status="version {richTextEditor.getStyle('version')}"
            styleName="opaquePanel"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_styleName_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/RichTextEditor_styleName_test/bin/main.html" width="100%" height="350"></iframe></p>
<p class="construction">As of the December 4, 2007 build, the defaults.css file (in the installed SDK folder&#8217;s \frameworks\projects\framework\ folder) lists the &#8220;.opaquePanel&#8221; style as:</p>
<pre class="code">
.opaquePanel
{
	backgroundColor: #FFFFFF;
	borderAlpha: 1;
	borderColor: #FFFFFF;
	footerColors: #E7E7E7, #C7C7C7;
	headerColors: #E7E7E7, #D9D9D9;
}
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the RichTextEditor control\&#039;s style name in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/31/changing-the-richtexteditor-controls-style-name-in-flex/',contentID: 'post-401',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'opaquePanel,styleName',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-richtexteditor-controls-style-name-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting a Flex application&#8217;s style name</title>
		<link>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/</link>
		<comments>http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 06:46:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[plain]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/</guid>
		<description><![CDATA[<p>The following example shows how you can use the styleName style in a Flex Application to remove the background image, set the background color to white and left aligns the content.</p> <p>To quote the Flex 2.0.1 documentation, &#8220;<a href="http://livedocs.adobe.com/flex/201/html/app_container_064_04.html">Overriding the default Application container styles</a>&#8220;:</p> <p> The Flex default style sheet defines a plain style name [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the <code>styleName</code> style in a Flex Application to remove the background image, set the background color to white and left aligns the content.</p>
<p>To quote the Flex 2.0.1 documentation, &#8220;<a href="http://livedocs.adobe.com/flex/201/html/app_container_064_04.html">Overriding the default Application container styles</a>&#8220;:</p>
<blockquote><p>
The Flex default style sheet defines a plain style name that sets all padding to 0 pixels, removes the default background image, sets the background color to white, and left-aligns the children.
</p></blockquote>
<p>Full code after the jump.</p>
<p><span id="more-192"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Application_styleName_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/18/setting-a-flex-applications-style-name/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function plainStyle():void {
                Application.application.setStyle("styleName", "plain");
            }

            private function defaultStyle():void {
                Application.application.setStyle("styleName", undefined);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="styleName = 'plain'"
                click="plainStyle();" /&gt;
        &lt;mx:Button label="styleName = undefined"
                click="defaultStyle();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Button label="Button 1" /&gt;
    &lt;mx:Button label="Button 2" /&gt;
    &lt;mx:Button label="Button 3" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Application_styleName_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/Application_styleName_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>As you can see in the previous example, when setting the Application&#8217;s <code>styleName</code> style to &#8220;plain&#8221;, the content becomes left aligned. If you want to center the content horizontally within the application, set the &lt;mx:Application /&gt; tag&#8217;s <code>horizontalAlign</code> style to &#8220;center&#8221;, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        <strong style="color:red;">horizontalAlign=&quot;center&quot;</strong>&gt;
    ...
&lt;/mx:Application&gt;
</pre>
<p>Note that you can also set the styleName style directly in the &lt;mx:Application /&gt; tag by using the following snippet:</p>
<pre class="code">
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        <strong style="color:red;">styleName=&quot;plain&quot;</strong>&gt;
    ...
&lt;/mx:Application&gt;
</pre>
<p class="new">OK, looking a bit closer, it seems you can also set the <code>styleName</code> as a property, which I think I prefer, and what the documentation says (<a href="http://livedocs.adobe.com/flex/201/langref/mx/core/Application.html">Application class documentation in the Flex 2.0.1 LiveDocs</a>). To use the styleName property instead of styleName style, change the &lt;mx:Script /&gt; code block in the previous (big) example to the following:</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        private function plainStyle():void {
            Application.application.styleName = "plain";
        }

        private function defaultStyle():void {
            Application.application.styleName = undefined;
        }
    ]]&gt;
&lt;/mx:Script&gt;
</pre>
<p>Also, looking at the default.css style sheet in the Flex 3 beta SDK (see: [FlexSDK]\frameworks\projects\framework\defaults.css):</p>
<pre class="code">
.plain
{
    backgroundColor: #FFFFFF;
    backgroundImage: "";
    horizontalAlign: "left";
    paddingBottom: 0;
    paddingLeft: 0;
    paddingRight: 0;
    paddingTop: 0;
}
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a Flex application\&#039;s style name on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/18/setting-a-flex-applications-style-name/',contentID: 'post-192',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'plain,styleName',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/18/setting-a-flex-applications-style-name/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Styling the HSlider control using CSS</title>
		<link>http://blog.flexexamples.com/2007/09/12/styling-the-hslider-control-using-css/</link>
		<comments>http://blog.flexexamples.com/2007/09/12/styling-the-hslider-control-using-css/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 07:22:22 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HSlider]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[VSlider]]></category>
		<category><![CDATA[@font face]]></category>
		<category><![CDATA[dataTipOffset]]></category>
		<category><![CDATA[dataTipPlacement]]></category>
		<category><![CDATA[dataTipPrecision]]></category>
		<category><![CDATA[dataTipStyleName]]></category>
		<category><![CDATA[labelStyleName]]></category>
		<category><![CDATA[styleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/12/styling-the-hslider-control-using-css/</guid>
		<description><![CDATA[<p>The following example shows how you can style a HSlider (or VSlider) control in Flex using Cascading Style Sheets (CSS).</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_styleName_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/12/styling-the-hslider-control-using-css/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face{ src: url("./fonts/arial.ttf"); fontFamily: "ArialEmbedded"; } .MyLabel { fontFamily: ArialEmbedded; fontSize: 15; fontWeight: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can style a HSlider (or VSlider) control in Flex using Cascading Style Sheets (CSS).</p>
<p>Full code after the jump.</p>
<p><span id="more-171"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_styleName_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/12/styling-the-hslider-control-using-css/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face{
            src: url("./fonts/arial.ttf");
            fontFamily: "ArialEmbedded";
        }

        .MyLabel {
            fontFamily: ArialEmbedded;
            fontSize: 15;
            fontWeight: normal;
        }

        .MyDataTip {
            backgroundAlpha: 1.0;
            backgroundColor: haloBlue;
            color: white;
            cornerRadius: 10;
            fontWeight: bold;
            letterSpacing: 1;
        }

        .MySlider {
            dataTipOffset: 0;
            dataTipPrecision: 0;
            dataTipPlacement: left;
            dataTipStyleName: MyDataTip;
            showTrackHighlight: true;
            labelStyleName: MyLabel;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="labelArr"&gt;
        &lt;mx:Number&gt;-10&lt;/mx:Number&gt;
        &lt;mx:Number&gt;0&lt;/mx:Number&gt;
        &lt;mx:Number&gt;10&lt;/mx:Number&gt;
        &lt;mx:Number&gt;20&lt;/mx:Number&gt;
    &lt;/mx:Array&gt;

    &lt;mx:HSlider id="slider"
            minimum="-10"
            maximum="20"
            labels="{labelArr}"
            snapInterval="1"
            tickInterval="10"
            styleName="MySlider" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_styleName_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/HSlider_styleName_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the HSlider control using CSS on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/12/styling-the-hslider-control-using-css/',contentID: 'post-171',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '@font face,dataTipOffset,dataTipPlacement,dataTipPrecision,dataTipStyleName,labelStyleName,styleName',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/12/styling-the-hslider-control-using-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding images using style sheets and the &lt;mx:Style&gt; tag</title>
		<link>http://blog.flexexamples.com/2007/07/25/embedding-images-using-style-sheets-and-the-tag/</link>
		<comments>http://blog.flexexamples.com/2007/07/25/embedding-images-using-style-sheets-and-the-tag/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 03:07:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[Embed]]></category>
		<category><![CDATA[class selector]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[mx:Style]]></category>
		<category><![CDATA[styleName]]></category>
		<category><![CDATA[type selector]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/25/embedding-images-using-style-sheets-and-the-tag/</guid>
		<description><![CDATA[<p>Just when you thought I may have run out of Embed examples&#8230; Here&#8217;s a quick example of embedding an PNG icon using an &#60;mx:Style&#62; block.</p> <p>Full code after the jump.</p> <p></p> <p>The following example creates a simple app with three Button control instances. As you can see the first two buttons both display a checkmark [...]]]></description>
			<content:encoded><![CDATA[<p>Just when you thought I may have run out of Embed examples&#8230; Here&#8217;s a quick example of embedding an PNG icon using an &lt;mx:Style&gt; block.</p>
<p>Full code after the jump.</p>
<p><span id="more-27"></span></p>
<p>The following example creates a simple app with three Button control instances. As you can see the first two buttons both display a checkmark icon even though no explicit icon or style was set on the button. This is because we created a style for the entire Button class, which sets the icon to an embedded asset, &#8220;bulletCheck.png&#8221;. The third button uses a different icon because we set the <code>styleName</code> property which overrides the <code>icon</code> style with the &#8220;bulletWarning.png&#8221; asset. Finally, if you click the last button instance, an Alert pop-up displays showing that the default Button styles cascade right down to the nested buttons within the Alert control.</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        /* This style applies to all Buttons, including those in Alert controls. */
        Button {
            icon: Embed(source="assets/bulletCheck.png");
        }

        /* Create a custom style class. */
        .bulletWarning {
            icon: Embed(source="assets/bulletWarning.png");
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;

            private var a:Alert;

            private function showAlert():void {
                a = Alert.show("message");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button label="bug" /&gt;
    &lt;mx:Button label="also a bug"/&gt;
    &lt;mx:Button label="Alert.show()" click="showAlert()" styleName="bulletWarning" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Embedding images using style sheets and the &amp;#60;mx:Style&amp;#62; tag on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/07/25/embedding-images-using-style-sheets-and-the-tag/',contentID: 'post-27',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'class selector,icon,mx:Style,styleName,type selector',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/07/25/embedding-images-using-style-sheets-and-the-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

