<?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; FxButtonBar</title>
	<atom:link href="http://blog.flexexamples.com/category/spark/fxbuttonbar/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>Determining if an item index is selected in an FxButtonBar control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 19:06:17 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[isItemIndexSelected()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/">&#8220;Determining if an item is selected in an FxButtonBar control in Flex Gumbo&#8221;</a>, we saw how you could determine if a specific item is selected in a Flex Gumbo FxButtonBar control by using the isItemSelected() method.</p> <p>The following example shows how you can determine if a specific item index is [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/">&#8220;Determining if an item is selected in an FxButtonBar control in Flex Gumbo&#8221;</a>, we saw how you could determine if a specific item is selected in a Flex Gumbo FxButtonBar control by using the <code>isItemSelected()</code> method.</p>
<p>The following example shows how you can determine if a specific item index is selected in a Flex Gumbo FxButtonBar control by using the <code>isItemIndexSelected()</code> method.</p>
<p>Full code after the jump.</p>
<p><span id="more-974"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_isItemIndexSelected_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            private function btnBar_updateComplete(evt:Event):void {
                lblNegOne.text = btnBar.isItemIndexSelected(-1).toString();
                lblZero.text = btnBar.isItemIndexSelected(0).toString();
                lblOne.text = btnBar.isItemIndexSelected(1).toString();
                lblTwo.text = btnBar.isItemIndexSelected(2).toString();
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="isItemIndexSelected(-1):"&gt;
                &lt;Label id="lblNegOne" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected(0):"&gt;
                &lt;Label id="lblZero" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected(1):"&gt;
                &lt;Label id="lblOne" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected(2):"&gt;
                &lt;Label id="lblTwo" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            updateComplete="btnBar_updateComplete(event);"&gt;
        &lt;dataProvider&gt;
            &lt;ArrayCollection source="[One,Two,Three,Four,Five,Six]" /&gt;
        &lt;/dataProvider&gt;
    &lt;/FxButtonBar&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Determining if an item index is selected in an FxButtonBar control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-974',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,isItemIndexSelected()',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/02/22/determining-if-an-item-index-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determining if an item is selected in an FxButtonBar control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 18:50:57 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[isItemSelected()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can determine if a specific item is selected in a Flex Gumbo FxButtonBar control by using the isItemSelected() method.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can determine if a specific item is selected in a Flex Gumbo FxButtonBar control by using the <code>isItemSelected()</code> method.</p>
<p>Full code after the jump.</p>
<p><span id="more-973"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_isItemSelected_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            private function btnBar_updateComplete(evt:Event):void {
                lblNull.text = btnBar.isItemSelected(null).toString();
                lblOne.text = btnBar.isItemSelected('One').toString();
                lblTwo.text = btnBar.isItemSelected('Two').toString();
                lblThree.text = btnBar.isItemSelected('Three').toString();
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="isItemSelected(null):"&gt;
                &lt;Label id="lblNull" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected('One'):"&gt;
                &lt;Label id="lblOne" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected('Two'):"&gt;
                &lt;Label id="lblTwo" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="isItemSelected('three'):"&gt;
                &lt;Label id="lblThree" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            updateComplete="btnBar_updateComplete(event);"&gt;
        &lt;dataProvider&gt;
            &lt;ArrayCollection source="[One,Two,Three,Four,Five,Six]" /&gt;
        &lt;/dataProvider&gt;
    &lt;/FxButtonBar&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Determining if an item is selected in an FxButtonBar control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-973',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,isItemSelected()',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/02/22/determining-if-an-item-is-selected-in-an-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting the selected item on the FxButtonBar control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 05:49:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[requiresSelection]]></category>
		<category><![CDATA[selectedItem]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/02/21/setting-the-selected-index-on-the-fxbuttonbar-control-in-flex-gumbo/">&#8220;Setting the selected index on the FxButtonBar control in Flex Gumbo&#8221;</a>, we saw how you could set the selected index on a Flex Gumbo FxButtonBar control by setting the selectedIndex property.</p> <p>The following example shows how you can set the selected item on a Flex Gumbo FxButtonBar control by setting [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/02/21/setting-the-selected-index-on-the-fxbuttonbar-control-in-flex-gumbo/">&#8220;Setting the selected index on the FxButtonBar control in Flex Gumbo&#8221;</a>, we saw how you could set the selected index on a Flex Gumbo FxButtonBar control by setting the <code>selectedIndex</code> property.</p>
<p>The following example shows how you can set the selected item on a Flex Gumbo FxButtonBar control by setting the <code>selectedItem</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-972"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_selectedItem_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        import mx.utils.ObjectUtil;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="requiresSelection:"&gt;
                &lt;FxCheckBox id="checkBox" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedItem:"&gt;
                &lt;Label text="{ObjectUtil.toString(btnBar.selectedItem)}" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem direction="horizontal"&gt;
                &lt;FxButton label="Select none"
                        fontWeight="bold"
                        click="btnBar.selectedItem = null;" /&gt;
                &lt;FxButton label="Select 'One'"
                        click="btnBar.selectedItem = 'One';" /&gt;
                &lt;FxButton label="Select 'Two'"
                        click="btnBar.selectedItem = 'Two';" /&gt;
                &lt;FxButton label="Select 'Three'"
                        click="btnBar.selectedItem = 'Three';" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            requiresSelection="{checkBox.selected}"&gt;
        &lt;dataProvider&gt;
            &lt;ArrayCollection source="[One,Two,Three,Four,Five,Six]" /&gt;
        &lt;/dataProvider&gt;
    &lt;/FxButtonBar&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the selected item on the FxButtonBar control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-972',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,requiresSelection,selectedItem',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/02/21/setting-the-selected-item-on-the-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a vertical Spark ButtonBar control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 15:36:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[ButtonBar (Spark)]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[VerticalLayout]]></category>
		<category><![CDATA[gap]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[skinClass]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can create a vertical Spark ButtonBar control in Flex 4 by setting the layout property to a VerticalLayout object and setting the gap property to -1.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&#62; &#60;s:Application name="Spark_ButtonBar_layout_VerticalLayout_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo"&#62; &#60;s:ButtonBar id="btnBar" horizontalCenter="0" verticalCenter="0"&#62; &#60;s:layout&#62; &#60;s:VerticalLayout [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a vertical Spark ButtonBar control in Flex 4 by setting the <code>layout</code> property to a VerticalLayout object and setting the <code>gap</code> property to -1.</p>
<p>Full code after the jump.</p>
<p><span id="more-963"></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>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_ButtonBar_layout_VerticalLayout_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"&gt;

    &lt;s:ButtonBar id="btnBar"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;s:layout&gt;
            &lt;s:VerticalLayout gap="-1" /&gt;
        &lt;/s:layout&gt;
        &lt;s:dataProvider&gt;
            &lt;s:ArrayList source="[Red,Orange,Yellow,Green,Blue]" /&gt;
        &lt;/s:dataProvider&gt;
    &lt;/s:ButtonBar&gt;

&lt;/s:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_ButtonBar_layout_VerticalLayout_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_ButtonBar_layout_VerticalLayout_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also set the button layout direction by creating a custom skin and setting the <code>skinClass</code> style, as seen in the following example:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_ButtonBar_layout_VerticalLayout_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"&gt;

    &lt;s:ButtonBar id="btnBar"
            horizontalCenter="0"
            verticalCenter="0"
            skinClass="skins.CustomButtonBarSkin"&gt;
        &lt;s:dataProvider&gt;
            &lt;s:ArrayList source="[Red,Orange,Yellow,Green,Blue]" /&gt;
        &lt;/s:dataProvider&gt;
    &lt;/s:ButtonBar&gt;

&lt;/s:Application&gt;
</pre>
<p>The custom MXML skin, skins/CustomButtonBarSkin.mxml, is as follows:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;s:Skin name="CustomButtonBarSkin"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        alpha.disabled="0.5"&gt;
    &lt;s:states&gt;
        &lt;s:State name="normal" /&gt;
        &lt;s:State name="disabled" /&gt;
    &lt;/s:states&gt;

    &lt;fx:Metadata&gt;
        &lt;![CDATA[
            [HostComponent("spark.components.ButtonBar")]
        ]]&gt;
    &lt;/fx:Metadata&gt;

    &lt;fx:Declarations&gt;
        &lt;fx:Component id="middleButton" &gt;
            &lt;s:ButtonBarButton skinClass="spark.skins.default.ButtonBarMiddleButtonSkin" /&gt;
        &lt;/fx:Component&gt;
    &lt;/fx:Declarations&gt;

    &lt;s:DataGroup id="dataGroup" width="100%" height="100%"&gt;
        &lt;s:layout&gt;
            &lt;s:VerticalLayout gap="-1"/&gt;
        &lt;/s:layout&gt;
    &lt;/s:DataGroup&gt;

&lt;/s:Skin&gt;
</pre>
<p>You can also set the <code>skinClass</code> style in an external .CSS file or &lt;Style/&gt; block, as seen in the following example:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_ButtonBar_layout_VerticalLayout_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"&gt;

    &lt;fx:Style&gt;
        @namespace s "library://ns.adobe.com/flex/spark";

        s|ButtonBar {
            skinClass: ClassReference("skins.CustomButtonBarSkin");
        }
    &lt;/fx:Style&gt;

    &lt;s:ButtonBar id="btnBar"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;s:dataProvider&gt;
            &lt;s:ArrayList source="[Red,Orange,Yellow,Green,Blue]" /&gt;
        &lt;/s:dataProvider&gt;
    &lt;/s:ButtonBar&gt;

&lt;/s:Application&gt;
</pre>
<p>Or, you can set the <code>skinClass</code> style using ActionScript, as seen in the following example:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_ButtonBar_layout_VerticalLayout_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="white"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import skins.CustomButtonBarSkin;

            private function btn_click(evt:MouseEvent):void {
                btnBar.setStyle("skinClass", CustomButtonBarSkin);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;s:Button id="btn"
            label="Set skin class"
            click="btn_click(event);"
            x="10"
            y="10" /&gt;

    &lt;s:ButtonBar id="btnBar"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;s:dataProvider&gt;
            &lt;s:ArrayList source="[Red,Orange,Yellow,Green,Blue]" /&gt;
        &lt;/s:dataProvider&gt;
    &lt;/s:ButtonBar&gt;

&lt;/s:Application&gt;
</pre>
<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: 'Creating a vertical Spark ButtonBar control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-963',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'gap,Gumbo,layout,skinClass',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/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determining when the selected item changes on the FxButtonBar control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 07:57:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[selectionChanged]]></category>
		<category><![CDATA[selectionChanging]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can determine when the selected item changes on the Flex Gumbo FxButtonBar control by listening for the selectionChanging or selectionChanged events.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can determine when the selected item changes on the Flex Gumbo FxButtonBar control by listening for the <code>selectionChanging</code> or <code>selectionChanged</code> events.</p>
<p>Full code after the jump.</p>
<p><span id="more-959"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_selectionChanged_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.events.IndexChangedEvent;

            private function btn_selectionChanging(evt:IndexChangedEvent):void {
                arrColl.addItem(evt);
            }

            private function btn_selectionChanged(evt:IndexChangedEvent):void {
                arrColl.addItem(evt);
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;ArrayCollection id="arrColl" /&gt;
    &lt;/Declarations&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="requiresSelection:"&gt;
                &lt;FxCheckBox id="checkBox" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem&gt;
                &lt;FxButtonBar id="btnBar"
                        requiresSelection="{checkBox.selected}"
                        selectionChanging="btn_selectionChanging(event);"
                        selectionChanged="btn_selectionChanged(event);"&gt;
                    &lt;dataProvider&gt;
                        &lt;ArrayCollection source="[One,Two,Three,Four,Five]" /&gt;
                    &lt;/dataProvider&gt;
                &lt;/FxButtonBar&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;DataGrid id="dataGrid"
            dataProvider="{arrColl}"
            width="100%"&gt;
        &lt;columns&gt;
            &lt;DataGridColumn dataField="type" /&gt;
            &lt;DataGridColumn dataField="oldIndex" /&gt;
            &lt;DataGridColumn dataField="newIndex" /&gt;
        &lt;/columns&gt;
    &lt;/DataGrid&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Determining when the selected item changes on the FxButtonBar control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-959',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,selectionChanged,selectionChanging',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/02/10/determining-when-the-selected-item-changes-on-the-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Requiring a user has an item selected on the FxButtonBar in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 07:28:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[requiresSelection]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can make sure that the Flex Gumbo FxButtonBar control has an item selected by setting the Boolean requiresSelection property.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can make sure that the Flex Gumbo FxButtonBar control has an item selected by setting the Boolean <code>requiresSelection</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-958"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_requiresSelection_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.utils.ObjectUtil;
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;ArrayCollection id="arrColl"
                source="[One,Two,Three,Four,Five]" /&gt;
    &lt;/Declarations&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="requiresSelection:"&gt;
                &lt;FxCheckBox id="checkBox"
                        selected="true" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedIndex:"&gt;
                &lt;Label text="{btnBar.selectedIndex}" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedItem:"&gt;
                &lt;Label text="{ObjectUtil.toString(btnBar.selectedItem)}" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            dataProvider="{arrColl}"
            requiresSelection="{checkBox.selected}" /&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Requiring a user has an item selected on the FxButtonBar in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/',contentID: 'post-958',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,requiresSelection',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/02/09/requiring-a-user-has-an-item-selected-on-the-fxbuttonbar-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the FxButtonBar control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 06:23:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxButtonBar]]></category>
		<category><![CDATA[dataProvider]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[selectedIndex]]></category>
		<category><![CDATA[selectedItem]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can use the Flex Gumbo FxButtonBar by setting the dataProvider property to an ArrayCollection object.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the Flex Gumbo FxButtonBar by setting the <code>dataProvider</code> property to an ArrayCollection object.</p>
<p>Full code after the jump.</p>
<p><span id="more-957"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.utils.ObjectUtil;
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;ArrayCollection id="arrColl"
                source="[One,Two,Three,Four,Five]" /&gt;
    &lt;/Declarations&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="selectedIndex:"&gt;
                &lt;Label text="{btnBar.selectedIndex}" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedItem:"&gt;
                &lt;Label text="{ObjectUtil.toString(btnBar.selectedItem)}" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            dataProvider="{arrColl}" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxButtonBar_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/FxButtonBar_test/bin/main_4878.html" width="100%" height="200"></iframe></p>
<p>You can also set the <code>dataProvider</code> property inline in MXML using the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.utils.ObjectUtil;
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="selectedIndex:"&gt;
                &lt;Label text="{btnBar.selectedIndex}" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedItem:"&gt;
                &lt;Label text="{ObjectUtil.toString(btnBar.selectedItem)}" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"&gt;
        &lt;dataProvider&gt;
            &lt;ArrayCollection source="[One,Two,Three,Four,Five]" /&gt;
        &lt;/dataProvider&gt;
    &lt;/FxButtonBar&gt;

&lt;/Application&gt;
</pre>
<p>Or, you can set the <code>dataProvider</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxButtonBar_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.utils.ObjectUtil;
            import mx.collections.ArrayCollection;

            private var arrColl:ArrayCollection;

            private function init():void {
                var arr:Array = ["One", "Two", "Three", "Four", "Five"];
                arrColl = new ArrayCollection(arr);
                btnBar.dataProvider = arrColl;
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="selectedIndex:"&gt;
                &lt;Label text="{btnBar.selectedIndex}" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="selectedItem:"&gt;
                &lt;Label text="{ObjectUtil.toString(btnBar.selectedItem)}" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxButtonBar id="btnBar"
            initialize="init();" /&gt;

&lt;/Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using the FxButtonBar control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/',contentID: 'post-957',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataProvider,Gumbo,selectedIndex,selectedItem',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/02/08/using-the-fxbuttonbar-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

