<?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; buttonStyleName</title>
	<atom:link href="http://blog.flexexamples.com/tag/buttonstylename/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>Styling the emphasized button on an MX Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 07:16:08 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[emphasizedSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1909</guid>
		<description><![CDATA[<p>The following example shows how you can style the emphasized button on a Halo/MX Alert control in Flex 4 by setting the buttonStyleName and emphasizedSkin styles.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Alert_buttonStyleName_emphasizedSkin_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/halo&#34;&#62; &#60;s:controlBarContent&#62; &#60;s:Button id=&#34;btn&#34; label=&#34;Show Alert&#34; click=&#34;btn_click(event);&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/halo&#34;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can style the emphasized button on a Halo/MX Alert control in Flex 4 by setting the <code>buttonStyleName</code> and <code>emphasizedSkin</code> styles.</p>
<p><span id="more-1909"></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/09/25/styling-the-emphasized-button-on-a-halo-alert-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;Halo_Alert_buttonStyleName_emphasizedSkin_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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Show Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</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;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        mx|Alert {
            buttonStyleName: alertBtnStyles;
        }
&nbsp;
        .alertBtnStyles {
            emphasizedSkin: ClassReference(&quot;skins.CustomDefaultButtonSkin&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;fx:Script</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;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                Alert.show<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Alert text&quot;</span>, <span style="color: #ff0000;">&quot;Alert title&quot;</span>, Alert.YES|Alert.NO<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</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:Script</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, <em>skins/CustomDefaultButtonSkin.mxml</em>, 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/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomDefaultButtonSkin&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;19&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<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;selectedUp&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;selectedOver&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;selectedDown&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;selectedDisabled&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: #7400FF;">&lt;fx:Script</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>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            public var cornerRadius:Number = <span style="color: #cc66cc;">2</span>;</span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var cr:Number = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;cornerRadius&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>cornerRadius != cr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    cornerRadius = cr;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</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: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> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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;{cornerRadius}&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;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.overStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedOver=<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;#990000&quot;</span></span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.over=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.selectedOver=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedOver=<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> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&quot;</span> 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;#FF0000&quot;</span> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> 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;#990000&quot;</span> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> 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, selectedOver&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, selectedOver&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, selectedOver&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, selectedOver&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> width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Halo_Alert_buttonStyleName_emphasizedSkin_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Halo_Alert_buttonStyleName_emphasizedSkin_test/main.html" width="100%" height="200"></iframe></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: 'Styling the emphasized button on an MX Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/',contentID: 'post-1909',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,emphasizedSkin,Gumbo',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/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting an image background on a Halo ButtonBar control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 06:59:17 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[firstButtonStyleName]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lastButtonStyleName]]></category>
		<category><![CDATA[skin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1474</guid>
		<description><![CDATA[<p>The following example shows how you can set an image background on a Halo ButtonBar control (with default Spark skin) in Flex 4 by setting the buttonStyleName, firstButtonStyleName, lastButtonStyleName, and skin styles.</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/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_ButtonBar_buttonStyleName_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/halo&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set an image background on a Halo ButtonBar control (with default Spark skin) in Flex 4 by setting the <code>buttonStyleName</code>, <code>firstButtonStyleName</code>, <code>lastButtonStyleName</code>, and <code>skin</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-1474"></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/09/setting-an-image-background-on-a-halo-buttonbar-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;Halo_ButtonBar_buttonStyleName_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;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        .buttonBarButtonStyles {
            skin: ClassReference(&quot;skins.CustomButtonBarButtonSkin&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;mx:ButtonBar</span> id=<span style="color: #ff0000;">&quot;btnBar&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]&quot;</span></span>
<span style="color: #000000;">            buttonStyleName=<span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span></span>
<span style="color: #000000;">            firstButtonStyleName=<span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span></span>
<span style="color: #000000;">            lastButtonStyleName=<span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span></span>
<span style="color: #000000;">            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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>The custom ButtonBar button skin class, skins/CustomButtonBarButtonSkin.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/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomButtonBarButtonSkin&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;selectedUp&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;selectedOver&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;selectedDown&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;selectedDisabled&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;!-- layer 1: shadow --&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> bottom=<span style="color: #ff0000;">&quot;-1&quot;</span> height=<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: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;black&quot;</span> </span>
<span style="color: #000000;">                    color.downStates=<span style="color: #ff0000;">&quot;white&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: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> alpha=<span style="color: #ff0000;">&quot;0.6&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:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('assets/pattern_149.gif')&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 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 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;black&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;black&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 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;white&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> 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;white&quot;</span> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> 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> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> 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, selectedOver&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;black&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, selectedOver&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;black&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;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&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, selectedOver&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;black&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, selectedOver&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;black&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> width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&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;black&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;black&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:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p>You can also set the <code>buttonStyleName</code> style in an external .CSS file or &lt;Style/&gt; block, as seen in the following example:</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/09/setting-an-image-background-on-a-halo-buttonbar-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;Halo_ButtonBar_buttonStyleName_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;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        mx|ButtonBar {
            buttonStyleName: buttonBarButtonStyles;
            firstButtonStyleName: buttonBarButtonStyles;
            lastButtonStyleName: buttonBarButtonStyles;
        }
&nbsp;
        .buttonBarButtonStyles {
            skin: ClassReference(&quot;skins.CustomButtonBarButtonSkin&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;mx:ButtonBar</span> id=<span style="color: #ff0000;">&quot;btnBar&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]&quot;</span></span>
<span style="color: #000000;">            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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can set the <code>buttonStyleName</code> style using ActionScript, as seen in the following example:</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/09/setting-an-image-background-on-a-halo-buttonbar-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;Halo_ButtonBar_buttonStyleName_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</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>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import skins.CustomButtonBarButtonSkin;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var buttonBarButtonStyles:CSSStyleDeclaration = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;.buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonBarButtonStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skin&quot;</span>, CustomButtonBarButtonSkin<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var buttonBarStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.ButtonBar&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonBarStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;buttonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonBarStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;firstButtonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonBarStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lastButtonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</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:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ButtonBar</span> id=<span style="color: #ff0000;">&quot;btnBar&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]&quot;</span></span>
<span style="color: #000000;">            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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</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/09/setting-an-image-background-on-a-halo-buttonbar-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;Halo_ButtonBar_buttonStyleName_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</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>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import skins.CustomButtonBarButtonSkin;</span>
<span style="color: #000000;">            import mx.controls.ButtonBar;</span>
&nbsp;
<span style="color: #000000;">            private var btnBar:ButtonBar;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var buttonBarButtonStyles:CSSStyleDeclaration = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;.buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonBarButtonStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skin&quot;</span>, CustomButtonBarButtonSkin<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                btnBar = new ButtonBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                btnBar.dataProvider = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;The&quot;</span>, <span style="color: #ff0000;">&quot;Quick&quot;</span>, <span style="color: #ff0000;">&quot;Brown&quot;</span>, <span style="color: #ff0000;">&quot;Fox&quot;</span>, <span style="color: #ff0000;">&quot;Jumps&quot;</span>, <span style="color: #ff0000;">&quot;Over&quot;</span>, <span style="color: #ff0000;">&quot;The&quot;</span>, <span style="color: #ff0000;">&quot;Lazy&quot;</span>, <span style="color: #ff0000;">&quot;Dog&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                btnBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;buttonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                btnBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;firstButtonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                btnBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lastButtonStyleName&quot;</span>, <span style="color: #ff0000;">&quot;buttonBarButtonStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                btnBar.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                btnBar.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>btnBar<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</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:Script</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 an image background on a Halo ButtonBar control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/',contentID: 'post-1474',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,firstButtonStyleName,Gumbo,lastButtonStyleName,skin',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/09/setting-an-image-background-on-a-halo-buttonbar-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a label&#8217;s font weight on a Flex LinkBar and ToggleButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 15:28:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[LinkBar]]></category>
		<category><![CDATA[ToggleButtonBar]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[fontWeight]]></category>
		<category><![CDATA[linkButtonStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can set the font weight of a label on LinkBar control and ToggleButton control in Flex by setting the linkButtonStyleName style and buttonStyleName style respectively.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; .myCustomLinkButtonStyleName { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the font weight of a label on LinkBar control and ToggleButton control in Flex by setting the <code>linkButtonStyleName</code> style and <code>buttonStyleName</code> style respectively.</p>
<p>Full code after the jump.</p>
<p><span id="more-449"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .myCustomLinkButtonStyleName {
            fontWeight: normal;
        }

        .myCustomButtonStyleName {
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:LinkBar id="linkBar"
            dataProvider="{arr}"
            linkButtonStyleName="myCustomLinkButtonStyleName" /&gt;

    &lt;mx:ToggleButtonBar id="toggleButtonBar"
            dataProvider="{arr}"
            buttonStyleName="myCustomButtonStyleName" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_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/LinkBar_linkButtonStyleName_fontWeight_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>Or, you can set the styles a bit more globally by using the following snippet:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        LinkBar {
            linkButtonStyleName: regularFontWeight;
        }

        ToggleButtonBar {
            buttonStyleName: regularFontWeight;
        }

        .regularFontWeight {
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:LinkBar id="linkBar"
            dataProvider="{arr}" /&gt;

    &lt;mx:ToggleButtonBar id="toggleButtonBar"
            dataProvider="{arr}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/LinkBar_linkButtonStyleName_fontWeight_test_2/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a label\&#039;s font weight on a Flex LinkBar and ToggleButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/',contentID: 'post-449',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,fontWeight,linkButtonStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/14/setting-a-labels-font-weight-on-a-flex-linkbar-and-togglebuttonbar-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting skins on the the Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 08:08:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonHeight]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[disabledSkin]]></category>
		<category><![CDATA[downSkin]]></category>
		<category><![CDATA[overSkin]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[upSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can skin the ButtonBar control in Flex by setting the buttonStyleName style and setting one or more of the following skin styles: skin, upSkin, overSkin, downSkin, disabledSkin.</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/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/ --&#62; &#60;mx:Application name=&#34;ButtonBar_buttonStyleName_skin_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; ButtonBar [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can skin the ButtonBar control in Flex by setting the <code>buttonStyleName</code> style and setting one or more of the following skin styles: <code>skin</code>, <code>upSkin</code>, <code>overSkin</code>, <code>downSkin</code>, <code>disabledSkin</code>.</p>
<p>Full code after the jump.</p>
<p><span id="more-437"></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/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;ButtonBar_buttonStyleName_skin_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>
        ButtonBar {
            buttonStyleName: myCustomButtonStyleName;
            color: #999999;
        }
&nbsp;
        .myCustomButtonStyleName {
            skin: Embed(source=&quot;assets/ButtonBarSkins.swf&quot;,
                        symbol=&quot;ButtonBarButton_skin&quot;);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.events.SliderEvent;</span>
&nbsp;
<span style="color: #339933;">            private function slider_change(evt:SliderEvent):void {</span>
<span style="color: #339933;">                buttonBar.setStyle(&quot;buttonHeight&quot;, evt.value);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Array</span> id=<span style="color: #ff0000;">&quot;arr&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</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:Object</span> label=<span style="color: #ff0000;">&quot;ButtonBar&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;ColorPicker&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;ComboBox&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;buttonHeight:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;24&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;64&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;slider_change(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ButtonBar</span> id=<span style="color: #ff0000;">&quot;buttonBar&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arr}&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>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_skin_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/ButtonBar_buttonStyleName_skin_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>For simplicity sake, I only set the generic &#8220;skin&#8221; style which applies to all states (up, over, down, and disabled). You will also notice that we embedded a skin from a SWF file and the skins various scale grid settings (<code>scaleGridTop</code>, <code>scaleGridBottom</code>, <code>scaleGridLeft</code>, and <code>scaleGridRight</code>) are set in the FLA/SWF file and not in the MXML file itself. This allows you to resize the ButtonBar control without distorting the 2 pixel border on the bottom of the skin.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting skins on the the Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/',contentID: 'post-437',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonHeight,buttonStyleName,disabledSkin,downSkin,overSkin,skin,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/2008/01/10/setting-skins-on-the-the-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Setting the button label text alignment in a Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 07:58:26 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[textAlign]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can change the text alignment of button labels in a ButtonBar control in Flex by setting the buttonStyleName and textAlign styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_textAlign_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; ButtonBar { buttonStyleName: myCustomButtonStyleName; } .myCustomButtonStyleName [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the text alignment of button labels in a ButtonBar control in Flex by setting the <code>buttonStyleName</code> and <code>textAlign</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-431"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_textAlign_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        ButtonBar {
            buttonStyleName: myCustomButtonStyleName;
        }

        .myCustomButtonStyleName {
            cornerRadius: 0;
            fontWeight: normal;
            textAlign: right;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Button" /&gt;
        &lt;mx:Object label="ButtonBar" /&gt;
        &lt;mx:Object label="CheckBox" /&gt;
        &lt;mx:Object label="ColorPicker" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            themeColor="haloSilver"
            buttonHeight="32"
            width="100%"&gt;
    &lt;/mx:ButtonBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_textAlign_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/ButtonBar_buttonStyleName_textAlign_test/bin/main.html" width="100%" height="100"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the button label text alignment in a Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/',contentID: 'post-431',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,textAlign',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/07/setting-the-button-label-text-alignment-in-a-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the button corner radius in a Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 07:34:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[cornerRadius]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can set the corner radius on a ButtonBar control in Flex by setting the buttonStyleName and cornerRadius styles.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/ --&#62; &#60;mx:Application name=&#34;ButtonBar_buttonStyleName_cornerRadius_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; .myCustomButtonStyleName { cornerRadius: 16; } &#60;/mx:Style&#62; &#160; &#60;mx:Array id=&#34;arr&#34;&#62; &#60;mx:Object label=&#34;Button&#34; /&#62; &#60;mx:Object label=&#34;ButtonBar&#34; /&#62; &#60;mx:Object [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the corner radius on a ButtonBar control in Flex by setting the <code>buttonStyleName</code> and <code>cornerRadius</code> styles.</p>
<p><span id="more-430"></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/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;ButtonBar_buttonStyleName_cornerRadius_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>
        .myCustomButtonStyleName {
            cornerRadius: 16;
        }
    <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:Array</span> id=<span style="color: #ff0000;">&quot;arr&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</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:Object</span> label=<span style="color: #ff0000;">&quot;ButtonBar&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;CheckBox&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;ColorPicker&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ButtonBar</span> id=<span style="color: #ff0000;">&quot;buttonBar&quot;</span></span>
<span style="color: #000000;">            buttonStyleName=<span style="color: #ff0000;">&quot;myCustomButtonStyleName&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arr}&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;32&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>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_cornerRadius_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/ButtonBar_buttonStyleName_cornerRadius_test/bin/main.html" width="100%" height="120"></iframe></p>
<p>If you want to set the <code>buttonStyleName</code> style using an external .CSS file or &lt;mx:Style /&gt; block, you can use code similar to the following snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
    ButtonBar {
        buttonStyleName: myCustomButtonStyleName;
    }
&nbsp;
    .myCustomButtonStyleName {
        cornerRadius: 16;
    }
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the button corner radius in a Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/',contentID: 'post-430',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,cornerRadius',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/07/setting-the-button-corner-radius-in-a-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Styling the Alert control&#8217;s nested buttons</title>
		<link>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/</link>
		<comments>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 15:43:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[buttonStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the appearance of the buttons in an Alert control in Flex by setting the buttonStyleName style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_buttonStyleName_fontFamily_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Style&#62; @font-face { src: local("Comic Sans MS"); fontFamily: myComicSansMS; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the appearance of the buttons in an Alert control in Flex by setting the <code>buttonStyleName</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-414"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_buttonStyleName_fontFamily_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Comic Sans MS");
            fontFamily: myComicSansMS;
            fontWeight: normal;
        }

        Alert {
            buttonStyleName: myCustomButtonStyleName;
        }

        .myCustomButtonStyleName {
            color: red;
            cornerRadius: 12;
            fontFamily: myComicSansMS;
            fontSize: 10;
            fontWeight: normal;
            textDecoration: underline;
            themeColor: red;
        }
    &lt;/mx:Style&gt;

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

            private var alert:Alert;

            private function init():void {
                var myMessage:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\\nDonec tincidunt sollicitudin sem.";
                var myTitle:String = "The quick brown fox jumped over the lazy dog";
                alert = Alert.show(myMessage, myTitle);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Launch alert" click="init();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_buttonStyleName_fontFamily_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/Alert_buttonStyleName_fontFamily_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the Alert control\&#039;s nested buttons on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/',contentID: 'post-414',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the fill colors of a ButtonBar control in Flex</title>
		<link>http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 03:03:44 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[fillAlphas]]></category>
		<category><![CDATA[fillColors]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can change the background fill colors of a ButtonBar control in Flex by setting the buttonStyleName, fillColors, and fillAlphas styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; .allButtons2 { /* Creates a gradient from [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the background fill colors of a ButtonBar control in Flex by setting the <code>buttonStyleName</code>, <code>fillColors</code>, and <code>fillAlphas</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-409"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .allButtons2 {
            /* Creates a gradient from red/orange when button is in the
               "out" state. */
            fillColors: red, haloOrange;
        }

        .allButtons4 {
            /* Creates a gradient from red/orange when button is in the
               "out" state. Creates a gradient from green/blue when
               button is in the "over" state. */
            fillColors: red, haloOrange, haloGreen, haloBlue;
        }

        .allButtonsSolid {
            fillColors: red, red;
        }

        .allButtonsSolidOpaque {
            fillAlphas: 1.0, 1.0;
            fillColors: red, red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ViewStack id="viewStack"
            visible="false"
            includeInLayout="false"&gt;
        &lt;mx:VBox label="One"&gt;
            &lt;mx:Label text="One" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox label="Two"&gt;
            &lt;mx:Label text="Two" /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox label="Three"&gt;
            &lt;mx:Label text="Three" /&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:ViewStack&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="2 fill colors defined:"&gt;
            &lt;mx:ButtonBar id="buttonBar2"
                    buttonStyleName="allButtons2"
                    dataProvider="{viewStack}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="4 fill colors defined:"&gt;
            &lt;mx:ButtonBar id="buttonBar4"
                    buttonStyleName="allButtons4"
                    dataProvider="{viewStack}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="solid fill:"&gt;
            &lt;mx:ButtonBar id="buttonBarSolid"
                    buttonStyleName="allButtonsSolid"
                    dataProvider="{viewStack}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="solid opaque fill:"&gt;
            &lt;mx:ButtonBar id="buttonBarSolidOpaque"
                    buttonStyleName="allButtonsSolidOpaque"
                    dataProvider="{viewStack}" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_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/ButtonBar_buttonStyleName_fillColors_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>As you can see in the previous example, there are four separate ButtonBar controls:<br />
1) The first ButtonBar control, <code>buttonBar2</code>, uses a custom <code>buttonStyleName</code> style (<code>.allButtons2</code>) which has an array of two items defined for its <code>fillColors</code> array:</p>
<pre class="code">
.allButtons2 {
    /* Creates a gradient from red/orange when button is in the
        "out" state. */
    fillColors: red, haloOrange;
}
</pre>
<p>These two colors specify the gradient that is used for each button in the ButtonBar control. As you can see, the top of the button has a red-ish hue and the bottom of the button has more of an orange-ish hue.</p>
<p>2) The second ButtonBar control, <code>buttonBar4</code>, uses a custom <code>buttonStyleName</code> style (<code>.allButtons4</code>) which has an array of four items defined for its <code>fillColors</code> array:</p>
<pre class="code">
.allButtons4 {
    /* Creates a gradient from red/orange when button is in the
       "out" state. Creates a gradient from green/blue when
       button is in the "over" state. */
    fillColors: red, haloOrange, haloGreen, haloBlue;
}
</pre>
<p>The first two colors specify the gradient that is used for the &#8220;out&#8221; state (the state where the cursor <em>is not</em> over the button) of each button. The last two colors specify the gradient that is used for the &#8220;over&#8221; state (the state where the cursor <em>is</em> over the button) of each button. So again, when the cursor is not over the button, the top of the button has a red-ish hue and the bottom of the button has more of an orange-ish hue. When the user moves their cursor over a button in the ButtonBar control, the button switches to a green-to-blue gradient.</p>
<p>3) The third ButtonBar control, <code>buttonBarSolid</code>, uses a custom <code>buttonStyleName</code> style (<code>.allButtonsSolid</code>) which has an array of two items defined for its <code>fillColors</code> array:</p>
<pre class="code">
.allButtonsSolid {
    fillColors: red, red;
}
</pre>
<p>Both of the colors are the same, giving each of the buttons a solid fill instead of a gradient fill. Similar to the first ButtonBar control, <code>buttonBar2</code>, moving the mouse cursor over each button in the ButtonBar control a slightly darker looking fill.</p>
<p>4) The fourth ButtonBar control, <code>buttonBarSolidOpaque</code>, uses a custom <code>buttonStyleName</code> style (<code>.allButtonsSolidOpaque</code>) which has an array of two items defined for its <code>fillColors</code> array, but it also defines a new style, <code>fillAlphas</code>, which is an array of alpha fill values:</p>
<pre class="code">
.allButtonsSolidOpaque {
    fillAlphas: 1.0, 1.0;
    fillColors: red, red;
}
</pre>
<p>As you can see, the fill colors are again using the same color for each entry, giving the button fill a solid fill instead of a gradient fill. The <code>fillAlphas</code> style is an array of two values, [1.0, 1.0], which controls the alpha for each of the items in the <code>fillColors</code> style array. This causes the fill color to appear as a deeper red, rather than a slightly faded/muted appearance.</p>
<p>You can also set the <code>fillColors</code> and <code>fillAlphas</code> styles using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .customButtonBarFillColors {
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".customButtonBarFillColors");
                cssObj.setStyle("fillColors", [0xFF0000, "haloOrange", "haloOrange", "#FF0000"]);
                cssObj.setStyle("fillAlphas", [1.0, 1.0, 0.2, 0.4]);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="button"
                label="set button styles"
                click="init();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar"
            buttonStyleName="customButtonBarFillColors"
            themeColor="haloOrange"&gt;
        &lt;mx:dataProvider&gt;
            &lt;mx:Array&gt;
                &lt;mx:String&gt;One&lt;/mx:String&gt;
                &lt;mx:String&gt;Two&lt;/mx:String&gt;
                &lt;mx:String&gt;Three&lt;/mx:String&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:dataProvider&gt;
    &lt;/mx:ButtonBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_buttonStyleName_fillColors_test_2/bin/main.html" width="100%" height="150"></iframe></p>
<p class="note">Note that you can also specify an additional two values for the <code>fillAlphas</code> style which represent the fill values when the current button in a ButtonBar control is in an &#8220;over&#8221; state, similar to the second ButtonBar control (<code>buttonBar4</code>) in the first example.</p>
<p>So in the previous example, when you roll over each button in the <code>buttonBar</code> ButtonBar control the fill alpha for the button goes from a solid 1.0/1.0 to a gradient fill alpha of 0.2/0.4 (20% alpha at the top of the button to 40% alpha at the bottom of the button).</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the fill colors of a ButtonBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/',contentID: 'post-409',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,fillAlphas,fillColors',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/02/changing-the-fill-colors-of-a-buttonbar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Styling the Flex Alert control</title>
		<link>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/</link>
		<comments>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 05:15:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Embed]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[@font face]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[messageStyleName]]></category>
		<category><![CDATA[titleStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/</guid>
		<description><![CDATA[<p>This is a more complex version of my previous example. This time in addition to making the Alert control&#8217;s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a more complex version of my previous example. This time in addition to making the Alert control&#8217;s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins.</p>
<p><span id="more-79"></span></p>
<p class="alert">Since this example uses the <strong>mx_internal</strong> namespace, you can't always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.</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/2007/08/11/styling-the-flex-alert-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Alert_style_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>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;showAlert()&quot;</span></span>
<span style="color: #000000;">        applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Used by the ApplicationControlBar control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;fileName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;fileSize&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Used by the Alert control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;message&quot;</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog.
&nbsp;
The quick brown fox jumped over the lazy dog.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:String</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog?<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:String</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            private var a:Alert;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                var appInfo:LoaderInfo = Application.application.loaderInfo;</span>
<span style="color: #339933;">                /* Just grab the filename from the SWF URL. */</span>
<span style="color: #339933;">                fileName = (appInfo.url).split(&quot;/&quot;).pop();</span>
<span style="color: #339933;">                /* Convert bytes to kilobytes. */</span>
<span style="color: #339933;">                fileSize = (appInfo.bytesTotal / 1024).toFixed(2);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function showAlert():void {</span>
<span style="color: #339933;">                Alert.yesLabel = &quot;Accept&quot;;</span>
<span style="color: #339933;">                Alert.noLabel = &quot;Reject&quot;;</span>
<span style="color: #339933;">                Alert.buttonWidth = 120;</span>
&nbsp;
<span style="color: #339933;">                a = Alert.show(</span>
<span style="color: #339933;">                        message,</span>
<span style="color: #339933;">                        title,</span>
<span style="color: #339933;">                        Alert.NO | Alert.YES</span>
<span style="color: #339933;">                    );</span>
<span style="color: #339933;">                /* Make the Alert form's text non-selectable. */</span>
<span style="color: #339933;">                a.mx_internal::alertForm.mx_internal::textField.selectable = false;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face{
            src: url(&quot;./fonts/base02.ttf&quot;);
            fontFamily: &quot;Base02&quot;;
        }
&nbsp;
        Alert {
            titleStyleName: &quot;alertTitle&quot;;
            messageStyleName: &quot;alertMessage&quot;;
            buttonStyleName: &quot;alertButton&quot;;
            dropShadowEnabled: true;
            shadowDistance: 5;
            shadowDirection: right;
            cornerRadius: 0;
            embedFonts: true;
            fontFamily: Base02;
        }
&nbsp;
        .alertTitle {
            letterSpacing: 0;
            fontSize: 14;
            color: red;
        }
&nbsp;
        .alertMessage {
            letterSpacing: 0;
            fontSize: 10;
            fontWeight: normal;
            color: black;
        }
&nbsp;
        .alertButton {
            letterSpacing: 0;
            fontSize: 11;
            cornerRadius: 10;
            fontWeight: normal;
            textRollOverColor: white;
            color: red;
            skin: ClassReference(null);
        }
    <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: #808080; font-style: italic;">&lt;!-- Display SWF name and file size. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> id=<span style="color: #ff0000;">&quot;applicationControlBar&quot;</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;info&quot;</span> text=<span style="color: #ff0000;">&quot;{fileName} ({fileSize}kb)&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Click to launch Alert control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span> click=<span style="color: #ff0000;">&quot;showAlert();&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>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_style_test/bin/srcview/index.html">View source</a> is enabled in the following application.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_style_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the Flex Alert control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/',contentID: 'post-79',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '@font face,buttonStyleName,messageStyleName,titleStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Styling buttons in an Alert control</title>
		<link>http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/</link>
		<comments>http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 05:05:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[cornerRadius]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/</guid>
		<description><![CDATA[<p>Here&#8217;s a basic example of applying a custom style to an Alert control&#8217;s buttons and giving them a nice, rounded effect.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_cornerRadius_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; .roundedAlertButtons { cornerRadius: 10; font-weight: bold; color: black; } &#60;/mx:Style&#62; &#60;mx:Script&#62; &#60;![CDATA[ [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a basic example of applying a custom style to an Alert control&#8217;s buttons and giving them a nice, rounded effect.</p>
<p>Full code after the jump.</p>
<p><span id="more-75"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_cornerRadius_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .roundedAlertButtons {
            cornerRadius: 10;
            font-weight: bold;
            color: black;
        }
    &lt;/mx:Style&gt;

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

            private var alert:Alert;

            private function showAlert():void {
                alert = Alert.show("The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.", "I'm an Alert control.", Alert.YES | Alert.NO);
                alert.setStyle("buttonStyleName", "roundedAlertButtons");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button label="Show alert" click="showAlert();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_cornerRadius_test/bin/srcview/index.html">View source</a> is enabled in the following example.</a></p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_cornerRadius_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling buttons in an Alert control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/',contentID: 'post-75',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,cornerRadius',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/09/styling-buttons-in-an-alert-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

