<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Adding icons to the Flex ButtonBar control</title>
	<atom:link href="http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 14:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rebecca</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-9340</link>
		<dc:creator>Rebecca</dc:creator>
		<pubDate>Mon, 27 Jun 2011 21:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-9340</guid>
		<description>I realize this is an old thread, but I&#039;m hoping you will spot this post and come to our rescue! I created a button in Flash. I exported it to a swf. In Flex 3, I can use the swf as an image on a button and it will automagically grab the up/over/down states in the swf. However, this will not work on a buttonbar in Flex3. We hope to have the buttonbar icons have different appearances for up/over/down (not just the background skin). Can this be done? Thanks.</description>
		<content:encoded><![CDATA[<p>I realize this is an old thread, but I&#8217;m hoping you will spot this post and come to our rescue! I created a button in Flash. I exported it to a swf. In Flex 3, I can use the swf as an image on a button and it will automagically grab the up/over/down states in the swf. However, this will not work on a buttonbar in Flex3. We hope to have the buttonbar icons have different appearances for up/over/down (not just the background skin). Can this be done? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sankar</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-7379</link>
		<dc:creator>sankar</dc:creator>
		<pubDate>Mon, 29 Mar 2010 17:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-7379</guid>
		<description>how to set the tabbar buttons width according to button label content (dynamic)</description>
		<content:encoded><![CDATA[<p>how to set the tabbar buttons width according to button label content (dynamic)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-7310</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 19 Mar 2010 20:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-7310</guid>
		<description>@Bill D,

This works for me:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
    
    &lt;mx:ButtonBar id=&quot;control_bbar&quot; width=&quot;200&quot; buttonHeight=&quot;25&quot; buttonWidth=&quot;25&quot;&gt;
        &lt;mx:dataProvider&gt;
            &lt;mx:ArrayCollection&gt;
                &lt;mx:Object icon=&quot;@Embed(source=&#039;accept.png&#039;)&quot; /&gt;
                &lt;mx:Object icon=&quot;@Embed(source=&#039;add.png&#039;)&quot; /&gt;
                &lt;mx:Object icon=&quot;@Embed(source=&#039;anchor.png&#039;)&quot; /&gt;
                &lt;mx:Object icon=&quot;@Embed(source=&#039;application.png&#039;)&quot; /&gt;
            &lt;/mx:ArrayCollection&gt;
        &lt;/mx:dataProvider&gt;
    &lt;/mx:ButtonBar&gt;
    
&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Bill D,</p>
<p>This works for me:</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: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</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;control_bbar&quot;</span> width=<span style="color: #ff0000;">&quot;200&quot;</span> buttonHeight=<span style="color: #ff0000;">&quot;25&quot;</span> buttonWidth=<span style="color: #ff0000;">&quot;25&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> icon=<span style="color: #ff0000;">&quot;@Embed(source='accept.png')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> icon=<span style="color: #ff0000;">&quot;@Embed(source='add.png')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> icon=<span style="color: #ff0000;">&quot;@Embed(source='anchor.png')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> icon=<span style="color: #ff0000;">&quot;@Embed(source='application.png')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ButtonBar</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>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill D</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-7309</link>
		<dc:creator>Bill D</dc:creator>
		<pubDate>Fri, 19 Mar 2010 18:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-7309</guid>
		<description>I&#039;m having a problem getting my icons to show up in a button bar. Here is the code I am using:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;mx:ButtonBar id=&quot;control_bbar&quot; height=&quot;20&quot; width=&quot;200&quot; buttonHeight=&quot;15&quot; buttonWidth=&quot;15&quot;&gt;
    &lt;mx:dataProvider&gt;
        &lt;mx:Object icon=&quot;@Embed(source=&#039;img/icon.png&#039;)&quot; /&gt;
    &lt;/mx:dataProvider&gt;
&lt;/mx:ButtonBar&gt;
&lt;/pre&gt;

I have tried every combination of the path to the icon.png file that I can think of and it still doesn&#039;t work. Labels show up fine, but not the icons. The PNG is smaller then the buttonHeight and buttonWidth. I am using Flex Builder 3. I have tried all of the various suggestions listed in the posts above. I also tried using a simple button with the icon, which works fine, so I then copied the path used by the Button for the mx:Object in the ButtonBar - still nothing.

Anybody have any ideas?

Thanks.
Bill</description>
		<content:encoded><![CDATA[<p>I&#8217;m having a problem getting my icons to show up in a button bar. Here is the code I am using:</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:ButtonBar</span> id=<span style="color: #ff0000;">&quot;control_bbar&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> width=<span style="color: #ff0000;">&quot;200&quot;</span> buttonHeight=<span style="color: #ff0000;">&quot;15&quot;</span> buttonWidth=<span style="color: #ff0000;">&quot;15&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> icon=<span style="color: #ff0000;">&quot;@Embed(source='img/icon.png')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ButtonBar</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>I have tried every combination of the path to the icon.png file that I can think of and it still doesn&#8217;t work. Labels show up fine, but not the icons. The PNG is smaller then the buttonHeight and buttonWidth. I am using Flex Builder 3. I have tried all of the various suggestions listed in the posts above. I also tried using a simple button with the icon, which works fine, so I then copied the path used by the Button for the mx:Object in the ButtonBar &#8211; still nothing.</p>
<p>Anybody have any ideas?</p>
<p>Thanks.<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam J</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-6710</link>
		<dc:creator>Adam J</dc:creator>
		<pubDate>Wed, 30 Dec 2009 20:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-6710</guid>
		<description>is there a way to specify the disabled icon also?</description>
		<content:encoded><![CDATA[<p>is there a way to specify the disabled icon also?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Molt</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-4627</link>
		<dc:creator>Molt</dc:creator>
		<pubDate>Sun, 19 Jul 2009 21:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-4627</guid>
		<description>thanks alot peter,
that solved my case&quot; though i had to add the slash :-D</description>
		<content:encoded><![CDATA[<p>thanks alot peter,<br />
that solved my case&#8221; though i had to add the slash :-D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjeet</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-2228</link>
		<dc:creator>Ranjeet</dc:creator>
		<pubDate>Fri, 17 Apr 2009 13:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-2228</guid>
		<description>I was facing a similar problem. Following format fixed it:
&lt;pre class=&quot;code&quot;&gt;
icon=&quot;@Embed(source=&#039;../assets/GD1.jpg&#039;)&quot;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I was facing a similar problem. Following format fixed it:</p>
<pre class="code">
icon="@Embed(source='../assets/GD1.jpg')"
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-2227</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 09 Apr 2009 20:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-2227</guid>
		<description>Scott Macdonald,

What if you remove the &quot;/&quot; before the assets directory?

Peter</description>
		<content:encoded><![CDATA[<p>Scott Macdonald,</p>
<p>What if you remove the &#8220;/&#8221; before the assets directory?</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Macdonald</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-2232</link>
		<dc:creator>Scott Macdonald</dc:creator>
		<pubDate>Thu, 09 Apr 2009 16:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-2232</guid>
		<description>The code generates an error. I placed an file named Editor.png in a folder in my Flex project named assets. When i attempted to reference it as such:

[Bindable]
            [Embed(&quot;/assets/Editor.png&quot;)]
            private var buttonIcon:Class;


i got this error:

Unable to resolve /assets/Editor.png for transcoding.

2nd -- which property needs to be set so that an icon appears in the application&#039;s main toolbar?</description>
		<content:encoded><![CDATA[<p>The code generates an error. I placed an file named Editor.png in a folder in my Flex project named assets. When i attempted to reference it as such:</p>
<p>[Bindable]<br />
            [Embed("/assets/Editor.png")]<br />
            private var buttonIcon:Class;</p>
<p>i got this error:</p>
<p>Unable to resolve /assets/Editor.png for transcoding.</p>
<p>2nd &#8212; which property needs to be set so that an icon appears in the application&#8217;s main toolbar?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/comment-page-1/#comment-2230</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 23 Jan 2009 17:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comment-2230</guid>
		<description>Fred,

Try something like this:
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Embed(&quot;Button.png&quot;)]
            private const ButtonIcon:Class;

            private function btn_click(evt:Event):void {
                /* Change the first button in the ButtonBar to use the embedded ButtonIcon asset. */
                Button(buttonBar .getChildAt(0)).setStyle(&quot;icon&quot;, ButtonIcon);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id=&quot;arr&quot;&gt;
        &lt;mx:Object label=&quot;Button&quot; icon=&quot;@Embed(&#039;ButtonBar.png&#039;)&quot; /&gt;
        &lt;mx:Object label=&quot;ButtonBar&quot; icon=&quot;@Embed(&#039;ButtonBar.png&#039;)&quot; /&gt;
        &lt;mx:Object label=&quot;CheckBox&quot; icon=&quot;@Embed(&#039;CheckBox.png&#039;)&quot; /&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Button label=&quot;Oops, I meant Button icon&quot;
                click=&quot;btn_click(event);&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id=&quot;buttonBar &quot; dataProvider=&quot;{arr}&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Fred,</p>
<p>Try something like this:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Embed("Button.png")]
            private const ButtonIcon:Class;

            private function btn_click(evt:Event):void {
                /* Change the first button in the ButtonBar to use the embedded ButtonIcon asset. */
                Button(buttonBar .getChildAt(0)).setStyle("icon", ButtonIcon);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arr"&gt;
        &lt;mx:Object label="Button" icon="@Embed('ButtonBar.png')" /&gt;
        &lt;mx:Object label="ButtonBar" icon="@Embed('ButtonBar.png')" /&gt;
        &lt;mx:Object label="CheckBox" icon="@Embed('CheckBox.png')" /&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Oops, I meant Button icon"
                click="btn_click(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ButtonBar id="buttonBar " dataProvider="{arr}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

