<?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; iconField</title>
	<atom:link href="http://blog.flexexamples.com/tag/iconfield/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing the label placement on an MX TabBar control in Flex</title>
		<link>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 02:41:44 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TabBar]]></category>
		<category><![CDATA[ClassFactory]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[labelField]]></category>
		<category><![CDATA[labelPlacement]]></category>
		<category><![CDATA[mx_internal]]></category>
		<category><![CDATA[navItemFactory]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3436</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/">&#8220;Changing the label placement on an MX ButtonBar control in Flex (redux)&#8221;</a>, we saw how you could set the label/icon placement on an MX ButtonBar control in Flex by extending the MX ButtonBar class and setting the navItemFactory property in the mx_internal namespace to a custom class.</p> <p>The following example [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/">&#8220;Changing the label placement on an MX ButtonBar control in Flex (redux)&#8221;</a>, we saw how you could set the label/icon placement on an MX ButtonBar control in Flex by extending the MX ButtonBar class and setting the <code>navItemFactory</code> property in the  <code>mx_internal</code> namespace to a custom class.</p>
<p>The following example shows how you can set the label/icon placement on an MX TabBar control in Flex by extending the MX TabBar class and setting the <code>navItemFactory</code> property in the  <code>mx_internal</code> namespace to a custom Tab button class.</p>
<p><span id="more-3436"></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/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_TabBar_navItemFactory_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;">        xmlns:comps=<span style="color: #ff0000;">&quot;comps.*&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;comps:CustomTabBar</span> id=<span style="color: #ff0000;">&quot;tb&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{viewstack}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;icon&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ViewStack</span> id=<span style="color: #ff0000;">&quot;viewstack&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_1&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 1&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonUp')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_2&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 2&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonOver')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_3&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 3&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonOver')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ComboBox</span> dataProvider=<span style="color: #ff0000;">&quot;[red,orange,yellow,green,blue]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ViewStack</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>The custom MX TabBar control, <em>comps/CustomTabBar.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>TabBar<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>ClassFactory<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>mx_internal<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomTabBar <span style="color: #0033ff; font-weight: bold;">extends</span> TabBar <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomTabBar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            mx_internal<span style="color: #000066; font-weight: bold;">::</span>navItemFactory = <span style="color: #0033ff; font-weight: bold;">new</span> ClassFactory<span style="color: #000000;">&#40;</span>CustomTab<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the custom nav item factory, <em>comps/CustomTab.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>tabBarClasses<span style="color: #000066; font-weight: bold;">.</span>Tab<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomTab <span style="color: #0033ff; font-weight: bold;">extends</span> Tab <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomTab<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            labelPlacement = <span style="color: #990000;">&quot;top&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the label placement on an MX TabBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/',contentID: 'post-3436',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'ClassFactory,icon,iconField,labelField,labelPlacement,mx_internal,navItemFactory',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-tabbar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Changing the label placement on an MX ButtonBar control in Flex (redux)</title>
		<link>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/</link>
		<comments>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 02:23:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[labelField]]></category>
		<category><![CDATA[labelPlacement]]></category>
		<category><![CDATA[mx_internal]]></category>
		<category><![CDATA[navItemFactory]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3433</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/">&#8220;Changing the label placement for a Flex ButtonBar control&#8221;</a>, we saw how you could change the button&#8217;s label placement relative to its icon in a ButtonBar control in Flex by using the getChildAt() method and labelPlacement property.</p> <p>The following example shows how you can set the label/icon placement on an [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/">&#8220;Changing the label placement for a Flex ButtonBar control&#8221;</a>, we saw how you could change the button&#8217;s label placement relative to its icon in a ButtonBar control in Flex by using the <code>getChildAt()</code> method and <code>labelPlacement</code> property.</p>
<p>The following example shows how you can set the label/icon placement on an MX ButtonBar control in Flex by extending the MX ButtonBar class and setting the <code>navItemFactory</code> property in the  <code>mx_internal</code> namespace to a custom class.</p>
<p><span id="more-3433"></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/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_ButtonBar_navItemFactory_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;">        xmlns:local=<span style="color: #ff0000;">&quot;*&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;local:CustomButtonBar</span> id=<span style="color: #ff0000;">&quot;bb&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{viewstack}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;icon&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ViewStack</span> id=<span style="color: #ff0000;">&quot;viewstack&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_1&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 1&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonUp')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_2&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 2&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonOver')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> id=<span style="color: #ff0000;">&quot;tab_3&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Tab 3&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('Assets.swf#CloseButtonOver')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ComboBox</span> dataProvider=<span style="color: #ff0000;">&quot;[red,orange,yellow,green,blue]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Canvas</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ViewStack</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>The custom MX ButtonBar control, <em>CustomButtonBar.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ButtonBar<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>ClassFactory<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>mx_internal<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomButtonBar <span style="color: #0033ff; font-weight: bold;">extends</span> ButtonBar <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomButtonBar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            mx_internal<span style="color: #000066; font-weight: bold;">::</span>navItemFactory = <span style="color: #0033ff; font-weight: bold;">new</span> ClassFactory<span style="color: #000000;">&#40;</span>CustomButtonBarButton<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the custom nav item factory, <em>CustomButtonBarButton.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>buttonBarClasses<span style="color: #000066; font-weight: bold;">.</span>ButtonBarButton<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomButtonBarButton <span style="color: #0033ff; font-weight: bold;">extends</span> ButtonBarButton <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomButtonBarButton<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            labelPlacement = <span style="color: #990000;">&quot;top&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the label placement on an MX ButtonBar control in Flex (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/',contentID: 'post-3433',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField,labelField,labelPlacement,mx_internal,navItemFactory',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/11/09/changing-the-label-placement-on-an-mx-buttonbar-control-in-flex-redux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Displaying icons in an MX MenuBar control in Flex</title>
		<link>http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 14:47:28 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[MenuBar]]></category>
		<category><![CDATA[iconField]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2352</guid>
		<description><![CDATA[<p>The following example shows how you can display icons in an MX MenuBar control in Flex by setting the iconField property.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/ --&#62; &#60;mx:Application name=&#34;MenuBar_iconField_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;top&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ [Embed(&#34;assets/BorderContainer.png&#34;)] public const BorderContainerIcon:Class; &#160; [Embed(&#34;assets/Button.png&#34;)] public const ButtonIcon:Class; &#160; [Embed(&#34;assets/ButtonBar.png&#34;)] public const ButtonBarIcon:Class; ]]&#62; &#60;/mx:Script&#62; &#160; &#60;mx:XMLListCollection [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display icons in an MX MenuBar control in Flex by setting the <code>iconField</code> property.</p>
<p><span id="more-2352"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MenuBar_iconField_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;top&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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            [Embed(&quot;assets/BorderContainer.png&quot;)]</span>
<span style="color: #339933;">            public const BorderContainerIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/Button.png&quot;)]</span>
<span style="color: #339933;">            public const ButtonIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/ButtonBar.png&quot;)]</span>
<span style="color: #339933;">            public const ButtonBarIcon:Class;</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:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;xmlListColl&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XMLList</span> xmlns=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;topmenu label=<span style="color: #ff0000;">&quot;BorderContainer&quot;</span> icon=<span style="color: #ff0000;">&quot;BorderContainerIcon&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Properties:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;backgroundFill : IFill&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderStroke : IStroke&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/submenu<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Methods:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;BorderContainer()&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/submenu<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Styles:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;backgroundImage : Object&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;backgroundImageFillMode : String&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderAlpha : Number&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderColor : uint&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderStyle : String&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderVisible : Boolean&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;borderWeight : Number&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;cornerRadius : Number&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;dropShadowVisible : Boolean&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/submenu<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/topmenu<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;topmenu label=<span style="color: #ff0000;">&quot;Button&quot;</span> icon=<span style="color: #ff0000;">&quot;ButtonIcon&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Properties:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Methods:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Styles:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/topmenu<span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;topmenu label=<span style="color: #ff0000;">&quot;ButtonBar&quot;</span> icon=<span style="color: #ff0000;">&quot;ButtonBarIcon&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Properties:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Methods:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Styles:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;submenu label=<span style="color: #ff0000;">&quot;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/topmenu<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:source</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:MenuBar</span> id=<span style="color: #ff0000;">&quot;mnBr&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{xmlListColl}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;@icon&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;20&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>Or you can set the <code>dataProvider</code> property to an MXML ArrayListCollection using 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/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MenuBar_iconField_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;top&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:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:source</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>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;BorderContainer&quot;</span> icon=<span style="color: #ff0000;">&quot;@Embed('assets/BorderContainer.png')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;Properties:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;backgroundFill : IFill&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;borderStroke : IStroke&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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;Methods:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;BorderContainer()&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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;Styles:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;backgroundImage : Object&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;backgroundImageFillMode : String&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;borderAlpha : Number&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;borderColor : uint&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;borderStyle : String&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;borderVisible : Boolean&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;borderWeight : Number&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;cornerRadius : Number&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;dropShadowVisible : Boolean&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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> icon=<span style="color: #ff0000;">&quot;@Embed('assets/Button.png')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;Properties:&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;Methods:&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;Styles:&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;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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> icon=<span style="color: #ff0000;">&quot;@Embed('assets/ButtonBar.png')&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:children</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;Properties:&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;Methods:&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;Styles:&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;Events:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:children</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Object</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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:source</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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:MenuBar</span> id=<span style="color: #ff0000;">&quot;mnBr&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;icon&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;20&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>Or you can create the ArrayListCollection object using ActionScript using the following awkward code:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MenuBar_iconField_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;top&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.collections.ArrayCollection;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/BorderContainer.png&quot;)]</span>
<span style="color: #339933;">            public const BorderContainerIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/Button.png&quot;)]</span>
<span style="color: #339933;">            public const ButtonIcon:Class;</span>
&nbsp;
<span style="color: #339933;">            [Embed(&quot;assets/ButtonBar.png&quot;)]</span>
<span style="color: #339933;">            public const ButtonBarIcon:Class;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">            [Bindable]</span>
<span style="color: #339933;">            public static var arrColl:ArrayCollection;</span>
&nbsp;
<span style="color: #339933;">            public function init():void {</span>
<span style="color: #339933;">                /* BorderContainer */</span>
<span style="color: #339933;">                var borderContainerProperties:Array = [];</span>
<span style="color: #339933;">                borderContainerProperties.push({label:&quot;backgroundFill : IFill&quot;});</span>
<span style="color: #339933;">                borderContainerProperties.push({label:&quot;borderStroke : IStroke&quot;});</span>
&nbsp;
<span style="color: #339933;">                var borderContainerMethods:Array = [];</span>
<span style="color: #339933;">                borderContainerMethods.push({label:&quot;BorderContainer()&quot;});</span>
&nbsp;
<span style="color: #339933;">                var borderContainerStyles:Array = [];</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;backgroundImage : Object&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;backgroundImageFillMode : String&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;borderAlpha : Number&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;borderColor : uint&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;borderStyle : String&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;borderVisible : Boolean&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;borderWeight : Number&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;cornerRadius : Number&quot;});</span>
<span style="color: #339933;">                borderContainerStyles.push({label:&quot;dropShadowVisible : Boolean&quot;});</span>
&nbsp;
<span style="color: #339933;">                var borderContainerEvents:Array = [];</span>
&nbsp;
<span style="color: #339933;">                var borderContainerObj:Object = {label:&quot;BorderContainer&quot;, icon:BorderContainerIcon,</span>
<span style="color: #339933;">                    children:[{label:&quot;Properties:&quot;, children:borderContainerProperties},</span>
<span style="color: #339933;">                        {label:&quot;Methods:&quot;, children:borderContainerMethods},</span>
<span style="color: #339933;">                        {label:&quot;Styles:&quot;, children:borderContainerStyles},</span>
<span style="color: #339933;">                        {label:&quot;Events:&quot;, children:borderContainerEvents}]};</span>
&nbsp;
<span style="color: #339933;">                /* Button */</span>
<span style="color: #339933;">                var buttonProperties:Array = [];</span>
<span style="color: #339933;">                var buttonMethods:Array = [];</span>
<span style="color: #339933;">                var buttonStyles:Array = [];</span>
<span style="color: #339933;">                var buttonEvents:Array = [];</span>
&nbsp;
<span style="color: #339933;">                var buttonObj:Object = {label:&quot;Button&quot;, icon:ButtonIcon,</span>
<span style="color: #339933;">                    children:[{label:&quot;Properties:&quot;, children:buttonProperties},</span>
<span style="color: #339933;">                        {label:&quot;Methods:&quot;, children:buttonMethods},</span>
<span style="color: #339933;">                        {label:&quot;Styles:&quot;, children:buttonStyles},</span>
<span style="color: #339933;">                        {label:&quot;Events:&quot;, children:buttonEvents}]};</span>
&nbsp;
<span style="color: #339933;">                /* ButtonBar */</span>
<span style="color: #339933;">                var buttonBarProperties:Array = [];</span>
<span style="color: #339933;">                var buttonBarMethods:Array = [];</span>
<span style="color: #339933;">                var buttonBarStyles:Array = [];</span>
<span style="color: #339933;">                var buttonBarEvents:Array = [];</span>
&nbsp;
<span style="color: #339933;">                var buttonBarObj:Object = {label:&quot;Button&quot;, icon:ButtonBarIcon,</span>
<span style="color: #339933;">                    children:[{label:&quot;Properties:&quot;, children:buttonBarProperties},</span>
<span style="color: #339933;">                        {label:&quot;Methods:&quot;, children:buttonBarMethods},</span>
<span style="color: #339933;">                        {label:&quot;Styles:&quot;, children:buttonBarStyles},</span>
<span style="color: #339933;">                        {label:&quot;Events:&quot;, children:buttonBarEvents}]};</span>
&nbsp;
<span style="color: #339933;">                arrColl = new ArrayCollection([borderContainerObj, buttonObj, buttonBarObj]);</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:MenuBar</span> id=<span style="color: #ff0000;">&quot;mnBr&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;icon&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying icons in an MX MenuBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/',contentID: 'post-2352',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/01/29/displaying-icons-in-an-mx-menubar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Displaying icons in a Flex PopUpButton control (Redux)</title>
		<link>http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/</link>
		<comments>http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 07:53:11 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Menu]]></category>
		<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[labelField]]></category>
		<category><![CDATA[popUp]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/">&#8220;Displaying icons in a Flex PopUpButton control&#8221;</a>, we saw how you could add icons to a PopUpButton control&#8217;s nested menu using an Array data provider.</p> <p>The following example shows you how you can add icons to a pop up menu in a PopUpButton control in Flex by specifying the iconField [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/">&#8220;Displaying icons in a Flex PopUpButton control&#8221;</a>, we saw how you could add icons to a PopUpButton control&#8217;s nested menu using an Array data provider.</p>
<p>The following example shows you how you can add icons to a pop up menu in a PopUpButton control in Flex by specifying the <code>iconField</code> property in the PopUpButton control&#8217;s nested Menu control using an XML data provider.</p>
<p>Full code after the jump.</p>
<p><span id="more-939"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/ --&gt;
&lt;mx:Application name="PopUpButton_popUp_Menu_iconField_test_2"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="top"
        backgroundColor="white"&gt;

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

            [Embed("assets/Button.png")]
            public const ButtonIcon:Class;

            [Embed("assets/ButtonBar.png")]
            public const ButtonBarIcon:Class;

            [Embed("assets/CheckBox.png")]
            public const CheckBoxIcon:Class;

            [Embed("assets/ColorPicker.png")]
            public const ColorPickerIcon:Class;

            [Bindable]
            private var menu:Menu;

            private function initMenu():void {
                menu = new Menu();
                menu.dataProvider = xmlList;
                menu.labelField = "@label";
                menu.iconField = "@icon";
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Style&gt;
        PopUpButton {
            popUpStyleName: myCustomPopUpStyleName;
        }

        .myCustomPopUpStyleName {
           fontWeight: normal;
           textAlign: left;
        }
    &lt;/mx:Style&gt;

    &lt;mx:XMLList id="xmlList"&gt;
        &lt;node label="Alert" /&gt;
        &lt;node label="Button" icon="ButtonIcon" /&gt;
        &lt;node label="ButtonBar" icon="ButtonBarIcon" /&gt;
        &lt;node label="CheckBox" icon="CheckBoxIcon" /&gt;
        &lt;node label="ColorPicker" icon="ColorPickerIcon" /&gt;
    &lt;/mx:XMLList&gt;

    &lt;mx:PopUpButton id="popUpButton"
            label="Select a control..."
            popUp="{menu}"
            preinitialize="initMenu();"
            creationComplete="popUpButton.open();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying icons in a Flex PopUpButton control (Redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/',contentID: 'post-939',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField,labelField,popUp',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/01/20/displaying-icons-in-a-flex-popupbutton-control-redux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting a custom tool tip field on a ButtonBar control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 17:16:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[labelField]]></category>
		<category><![CDATA[toolTipField]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can specify a custom field to be used for a tool tip in a Flex ButtonBar control by setting the toolTipField property.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/ --&#62; &#60;mx:Application name=&#34;ButtonBar_toolTipField_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:Array id=&#34;arr&#34;&#62; &#60;mx:Object label=&#34;Accordion&#34; toolTip=&#34;Le Accordion&#34; icon=&#34;@Embed('assets/Accordion.png')&#34; /&#62; &#60;mx:Object label=&#34;ApplicationControlBar&#34; toolTip=&#34;Le ApplicationControlBar&#34; icon=&#34;@Embed('assets/ApplicationControlBar.png')&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can specify a custom field to be used for a tool tip in a Flex ButtonBar control by setting the <code>toolTipField</code> property.</p>
<p><span id="more-610"></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/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;ButtonBar_toolTipField_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: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;Accordion&quot;</span></span>
<span style="color: #000000;">                toolTip=<span style="color: #ff0000;">&quot;Le Accordion&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('assets/Accordion.png')&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;ApplicationControlBar&quot;</span></span>
<span style="color: #000000;">                toolTip=<span style="color: #ff0000;">&quot;Le ApplicationControlBar&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('assets/ApplicationControlBar.png')&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;Box&quot;</span></span>
<span style="color: #000000;">                toolTip=<span style="color: #ff0000;">&quot;Le Box&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('assets/Box.png')&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;Canvas&quot;</span></span>
<span style="color: #000000;">                toolTip=<span style="color: #ff0000;">&quot;Le Canvas&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('assets/Canvas.png')&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;ControlBar&quot;</span></span>
<span style="color: #000000;">                toolTip=<span style="color: #ff0000;">&quot;Le ControlBar&quot;</span></span>
<span style="color: #000000;">                icon=<span style="color: #ff0000;">&quot;@Embed('assets/ControlBar.png')&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;">            dataProvider=<span style="color: #ff0000;">&quot;{arr}&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">            toolTipField=<span style="color: #ff0000;">&quot;toolTip&quot;</span></span>
<span style="color: #000000;">            iconField=<span style="color: #ff0000;">&quot;icon&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_toolTipField_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_toolTipField_test/bin/main.html" width="100%" height="100"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a custom tool tip field on a ButtonBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/',contentID: 'post-610',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField,labelField,toolTipField',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/04/27/setting-a-custom-tool-tip-field-on-a-buttonbar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating a simple image gallery with the Flex HorizontalList control</title>
		<link>http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/</link>
		<comments>http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 05:08:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HorizontalList]]></category>
		<category><![CDATA[columnCount]]></category>
		<category><![CDATA[columnWidth]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/</guid>
		<description><![CDATA[<p>This request comes to us from a faithful reader who was wondering how you can display a full image when a user clicks on a thumbnail in a HorizontalList control in Flex. My solution was to put the thumbnail image and full image URLs in the data provider and then use bindings to the HorizontalList [...]]]></description>
			<content:encoded><![CDATA[<p>This request comes to us from a faithful reader who was wondering how you can display a full image when a user clicks on a thumbnail in a HorizontalList control in Flex. My solution was to put the thumbnail image and full image URLs in the data provider and then use bindings to the HorizontalList control&#8217;s <code>selectedItem</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-522"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HorizontalList_selectedItem_test/main.mxml">View MXML</a></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/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;HorizontalList_selectedItem_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;top&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: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;Flex&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/fx_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/fx_appicon.jpg&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;Flash&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/fl_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/fl_appicon.jpg&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;Illustrator&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/ai_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/ai_appicon.jpg&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;Dreamweaver&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/dw_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/dw_appicon.jpg&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;ColdFusion&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/cf_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/cf_appicon.jpg&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;Flash Player&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/fl_player_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/fl_player_appicon.jpg&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;Fireworks&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/fw_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/fw_appicon.jpg&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;Lightroom&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/lr_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/lr_appicon.jpg&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;Photoshop&quot;</span></span>
<span style="color: #000000;">                thumbnailImage=<span style="color: #ff0000;">&quot;assets/ps_appicon-tn.gif&quot;</span></span>
<span style="color: #000000;">                fullImage=<span style="color: #ff0000;">&quot;assets/ps_appicon.jpg&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:Panel</span> title=<span style="color: #ff0000;">&quot;{horizontalList.selectedItem.label}&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">            horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Image</span> id=<span style="color: #ff0000;">&quot;img&quot;</span></span>
<span style="color: #000000;">                source=<span style="color: #ff0000;">&quot;{horizontalList.selectedItem.fullImage}&quot;</span></span>
<span style="color: #000000;">                maintainAspectRatio=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;{horizontalList.width}&quot;</span></span>
<span style="color: #000000;">                height=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ControlBar</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HorizontalList</span> id=<span style="color: #ff0000;">&quot;horizontalList&quot;</span></span>
<span style="color: #000000;">                    labelField=<span style="color: #ff0000;">&quot;label&quot;</span></span>
<span style="color: #000000;">                    iconField=<span style="color: #ff0000;">&quot;thumbnailImage&quot;</span></span>
<span style="color: #000000;">                    dataProvider=<span style="color: #ff0000;">&quot;{arr}&quot;</span></span>
<span style="color: #000000;">                    itemRenderer=<span style="color: #ff0000;">&quot;CustomItemRenderer&quot;</span></span>
<span style="color: #000000;">                    columnCount=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #000000;">                    columnWidth=<span style="color: #ff0000;">&quot;125&quot;</span></span>
<span style="color: #000000;">                    rowCount=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                    rowHeight=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">                    horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ControlBar</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</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="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HorizontalList_selectedItem_test/CustomItemRenderer.mxml">View CustomItemRenderer.mxml</a></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/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span> name=<span style="color: #ff0000;">&quot;CustomItemRenderer&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;">        horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Image</span> source=<span style="color: #ff0000;">&quot;{data.thumbnailImage}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;{data.label}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HorizontalList_selectedItem_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/HorizontalList_selectedItem_test/bin/main.html" width="100%" height="600"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a simple image gallery with the Flex HorizontalList control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/',contentID: 'post-522',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'columnCount,columnWidth,iconField,itemRenderer',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/02/15/creating-a-simple-image-gallery-with-the-flex-horizontallist-control/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
		<item>
		<title>Adding icons to the Flex LinkBar control</title>
		<link>http://blog.flexexamples.com/2008/02/09/adding-icons-to-the-flex-linkbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/02/09/adding-icons-to-the-flex-linkbar-control/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 05:19:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[LinkBar]]></category>
		<category><![CDATA[iconField]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/09/adding-icons-to-the-flex-linkbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can add icons to the LinkBar control in Flex by setting the iconField property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_dataProvider_Array_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/09/adding-icons-to-the-flex-linkbar-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Array id="arr"&#62; &#60;mx:Object label="Button" ico="@Embed('assets/Button.png')" /&#62; &#60;mx:Object label="ButtonBar" ico="@Embed('assets/ButtonBar.png')" /&#62; &#60;mx:Object label="CheckBox" ico="@Embed('assets/CheckBox.png')" /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can add icons to the LinkBar control in Flex by setting the <code>iconField</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-455"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_dataProvider_Array_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/02/09/adding-icons-to-the-flex-linkbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Button"
                ico="@Embed('assets/Button.png')" /&gt;
        &lt;mx:Object label="ButtonBar"
                ico="@Embed('assets/ButtonBar.png')" /&gt;
        &lt;mx:Object label="CheckBox"
                ico="@Embed('assets/CheckBox.png')" /&gt;
        &lt;mx:Object label="ColorPicker"
                ico="@Embed('assets/ColorPicker.png')" /&gt;
    &lt;/mx:Array&gt;

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

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_dataProvider_Array_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_dataProvider_Array_test/bin/main.html" width="100%" height="100"></iframe></p>
<p>If you are using a ViewStack as a data provider for the LinkBar control, you could use the following code instead:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_dataProvider_ViewStack_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/02/09/adding-icons-to-the-flex-linkbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

    &lt;mx:ViewStack id="viewStack" width="{linkBar.width}"&gt;
        &lt;mx:VBox label="Button"
                icon="@Embed('assets/Button.png')"&gt;
            &lt;mx:Label text="Button..." /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox label="ButtonBar"
                icon="@Embed('assets/ButtonBar.png')"&gt;
            &lt;mx:Label text="ButtonBar..." /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox label="CheckBox"
                icon="@Embed('assets/CheckBox.png')"&gt;
            &lt;mx:Label text="CheckBox..." /&gt;
        &lt;/mx:VBox&gt;
        &lt;mx:VBox label="ColorPicker"
                icon="@Embed('assets/ColorPicker.png')"&gt;
            &lt;mx:Label text="ColorPicker..." /&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:ViewStack&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkBar_dataProvider_ViewStack_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_dataProvider_ViewStack_test/bin/main.html" width="100%" height="120"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding icons to the Flex LinkBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/09/adding-icons-to-the-flex-linkbar-control/',contentID: 'post-455',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField',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/02/09/adding-icons-to-the-flex-linkbar-control/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Displaying icons in a Flex PopUpButton control</title>
		<link>http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 07:57:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[popUp]]></category>
		<category><![CDATA[popUpStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/</guid>
		<description><![CDATA[<p>The following example shows you how you can add items to a pop up menu in a PopUpButton control in Flex by specifying the iconField property in the PopUpButton control&#8217;s nested Menu control.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_iconField_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can add items to a pop up menu in a PopUpButton control in Flex by specifying the <code>iconField</code> property in the PopUpButton control&#8217;s nested Menu control.</p>
<p>Full code after the jump.</p>
<p><span id="more-472"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_iconField_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="top"
        backgroundColor="white"&gt;

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

            [Bindable]
            private var menu:Menu;

            private function initMenu():void {
                menu = new Menu();
                menu.dataProvider = arr;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Style&gt;
        PopUpButton {
            popUpStyleName: myCustomPopUpStyleName;
        }

        .myCustomPopUpStyleName {
           fontWeight: normal;
           textAlign: left;
        }
    &lt;/mx:Style&gt;

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

    &lt;mx:PopUpButton id="popUpButton"
            label="Select a control..."
            popUp="{menu}"
            preinitialize="initMenu();"
            creationComplete="popUpButton.open();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_iconField_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/PopUpButton_popUp_iconField_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>If your data provider didn&#8217;t have an &#8220;icon&#8221; field, you could set the <code>iconField</code> property on the Menu instance to the field with the icon you want to display, as shown in the following snippet:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_iconField_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;mx:Array id=&quot;arr&quot;&gt;
    &lt;mx:Object label=&quot;Alert&quot; /&gt;
    &lt;mx:Object label=&quot;Button&quot;
            <strong style="color:red;">img=&quot;@Embed(&#39;assets/Button.png&#39;)&quot;</strong> /&gt;
    &lt;mx:Object label=&quot;ButtonBar&quot;
            <strong style="color:red;">img=&quot;@Embed(&#39;assets/ButtonBar.png&#39;)&quot;</strong> /&gt;
    &lt;mx:Object label=&quot;CheckBox&quot;
            <strong style="color:red;">img=&quot;@Embed(&#39;assets/CheckBox.png&#39;)&quot;</strong> /&gt;
    &lt;mx:Object label=&quot;ColorPicker&quot;
            <strong style="color:red;">img=&quot;@Embed(&#39;assets/ColorPicker.png&#39;)&quot;</strong> /&gt;
&lt;/mx:Array&gt;

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

        [Bindable]
        private var menu:Menu;

        private function initMenu():void {
            menu = new Menu();
            <strong style="color:red;">menu.iconField = &quot;img&quot;;</strong>
            menu.dataProvider = arr;
        }
    ]]&gt;
&lt;/mx:Script&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_iconField_test_2/bin/srcview/index.html">View source</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying icons in a Flex PopUpButton control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/24/displaying-icons-in-a-flex-popupbutton-control/',contentID: 'post-472',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconField,popUp,popUpStyleName',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/24/displaying-icons-in-a-flex-popupbutton-control/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Changing the label placement for a Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 08:18:50 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[getChildAt()]]></category>
		<category><![CDATA[iconField]]></category>
		<category><![CDATA[labelPlacement]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can change the button&#8217;s label placement relative to its icon in a ButtonBar control in Flex by using the getChildAt() method and labelPlacement property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_getChildAt_labelPlacement_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-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:Script&#62; &#60;![CDATA[ import mx.controls.Button; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the button&#8217;s label placement relative to its icon in a ButtonBar control in Flex by using the <code>getChildAt()</code> method and <code>labelPlacement</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-432"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_getChildAt_labelPlacement_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/08/changing-the-label-placement-for-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:Script&gt;
        &lt;![CDATA[
            import mx.controls.Button;
            import mx.controls.ButtonLabelPlacement;

            [Bindable]
            [Embed("assets/arrow_down.png")]
            private var arrowDown:Class;

            [Bindable]
            [Embed("assets/arrow_left.png")]
            private var arrowLeft:Class;

            [Bindable]
            [Embed("assets/arrow_right.png")]
            private var arrowRight:Class;

            [Bindable]
            [Embed("assets/arrow_up.png")]
            private var arrowUp:Class;

            private function init():void {
                var idx:uint;
                var len:uint = buttonBar.numChildren;
                var btn:Button;
                /* Loop over each button. */
                for (idx = 0; idx &lt; len; idx++) {
                    /* Get reference to current Button. */
                    btn = buttonBar.getChildAt(idx) as Button;
                    /* Set labelPlacement property to current item in
                       arr Array object. */
                    btn.labelPlacement = arr[idx].label;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="left" img="{arrowLeft}" /&gt;
        &lt;mx:Object label="right" img="{arrowRight}" /&gt;
        &lt;mx:Object label="top" img="{arrowUp}" /&gt;
        &lt;mx:Object label="bottom" img="{arrowDown}" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            iconField="img"
            buttonHeight="64"
            width="500"
            creationComplete="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_getChildAt_labelPlacement_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_getChildAt_labelPlacement_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the label placement for a Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/08/changing-the-label-placement-for-a-flex-buttonbar-control/',contentID: 'post-432',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getChildAt(),iconField,labelPlacement',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/08/changing-the-label-placement-for-a-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adding icons to the Flex ButtonBar control</title>
		<link>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 07:02:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ButtonBar]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[iconField]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/</guid>
		<description><![CDATA[<p>The following example shows how you can add icons to the ButtonBar control in Flex.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_iconField_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ [Bindable] [Embed("assets/Button.png")] private var buttonIcon:Class; [Bindable] [Embed("assets/ButtonBar.png")] private var buttonBarIcon:Class; [Bindable] [Embed("assets/CheckBox.png")] private var checkBoxIcon:Class; [Bindable] [Embed("assets/ColorPicker.png")] [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can add icons to the ButtonBar control in Flex.</p>
<p>Full code after the jump.</p>
<p><span id="more-429"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_iconField_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/adding-icons-to-the-flex-buttonbar-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Bindable]
            [Embed("assets/Button.png")]
            private var buttonIcon:Class;

            [Bindable]
            [Embed("assets/ButtonBar.png")]
            private var buttonBarIcon:Class;

            [Bindable]
            [Embed("assets/CheckBox.png")]
            private var checkBoxIcon:Class;

            [Bindable]
            [Embed("assets/ColorPicker.png")]
            private var colorPickerIcon:Class;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Button" icon="{buttonIcon}" /&gt;
        &lt;mx:Object label="ButtonBar" icon="{buttonBarIcon}" /&gt;
        &lt;mx:Object label="CheckBox" icon="{checkBoxIcon}" /&gt;
        &lt;mx:Object label="ColorPicker" icon="{colorPickerIcon}" /&gt;
    &lt;/mx:Array&gt;

    &lt;!-- The data provider has an "icon" property. --&gt;
    &lt;mx:ButtonBar id="buttonBar"
            dataProvider="{arr}"
            height="32" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ButtonBar_iconField_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_iconField_test/bin/main.html" width="100%" height="100"></iframe></p>
<p>The previous example works because the the data provider has an &#8220;icon&#8221; field, and the default value for the ButtonBar control&#8217;s <code>iconField</code> property is &#8220;icon&#8221;.</p>
<p>The following snippet shows how you can override the default value for the ButtonBar control&#8217;s <code>iconField</code> property in MXML:</p>
<pre class="code">
&lt;mx:Array id=&quot;arr&quot;&gt;
    &lt;mx:Object label=&quot;Button&quot; img=&quot;{buttonIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ButtonBar&quot; img=&quot;{buttonBarIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;CheckBox&quot; img=&quot;{checkBoxIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ColorPicker&quot; img=&quot;{colorPickerIcon}&quot; /&gt;
&lt;/mx:Array&gt;

&lt;!-- The data provider has an &quot;img&quot; property, so use ButtonBar
     control's iconField property to set the icons on the
     control. --&gt;
&lt;mx:ButtonBar id=&quot;buttonBar&quot;
        dataProvider=&quot;{arr}&quot;
        <strong style="color:red;">iconField=&quot;img&quot;</strong>
        height=&quot;32&quot; /&gt;
</pre>
<p>You could also set the <code>iconField</code> property using ActionScript, as shown in the following snippet:</p>
<pre class="code">
<strong style="color:red;">&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.events.FlexEvent;

        private function buttonBar_initialize(evt:FlexEvent):void {
            buttonBar.iconField = &quot;img&quot;;
        }
    ]]&gt;
&lt;/mx:Script&gt;</strong>

&lt;mx:Array id=&quot;arr&quot;&gt;
    &lt;mx:Object label=&quot;Button&quot; img=&quot;{buttonIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ButtonBar&quot; img=&quot;{buttonBarIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;CheckBox&quot; img=&quot;{checkBoxIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ColorPicker&quot; img=&quot;{colorPickerIcon}&quot; /&gt;
&lt;/mx:Array&gt;

&lt;mx:ButtonBar id=&quot;buttonBar&quot;
        dataProvider=&quot;{arr}&quot;
        height=&quot;32&quot;
        <strong style="color:red;">initialize=&quot;buttonBar_initialize(event);&quot;</strong> /&gt;
</pre>
<p>Or, the slightly more condensed version:</p>
<pre class="code">
&lt;mx:Array id=&quot;arr&quot;&gt;
    &lt;mx:Object label=&quot;Button&quot; img=&quot;{buttonIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ButtonBar&quot; img=&quot;{buttonBarIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;CheckBox&quot; img=&quot;{checkBoxIcon}&quot; /&gt;
    &lt;mx:Object label=&quot;ColorPicker&quot; img=&quot;{colorPickerIcon}&quot; /&gt;
&lt;/mx:Array&gt;

&lt;mx:ButtonBar id=&quot;buttonBar&quot;
        dataProvider=&quot;{arr}&quot;
        height=&quot;32&quot;
        <strong style="color:red;">initialize=&quot;buttonBar.iconField = &#39;img&#39;;&quot;</strong> /&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding icons to the Flex ButtonBar control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/07/adding-icons-to-the-flex-buttonbar-control/',contentID: 'post-429',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'icon,iconField',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/adding-icons-to-the-flex-buttonbar-control/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

