<?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; Repeater</title>
	<atom:link href="http://blog.flexexamples.com/category/repeater/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>Toggling child recycling on a Repeater in Flex</title>
		<link>http://blog.flexexamples.com/2009/10/08/toggling-child-recycling-on-a-repeater-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/10/08/toggling-child-recycling-on-a-repeater-in-flex/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 05:05:42 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Repeater]]></category>
		<category><![CDATA[recycleChildren]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1987</guid>
		<description><![CDATA[<p>The following example shows how you can toggle child recycling in a Repeater object in Flex by setting the Boolean recycleChildren property.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/10/08/toggling-child-recycling-on-a-repeater-in-flex/ --&#62; &#60;mx:Application name=&#34;Repeater_recycleChildren_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:Script&#62; &#60;![CDATA[ import mx.controls.Alert; ]]&#62; &#60;/mx:Script&#62; &#160; &#60;mx:ArrayCollection id=&#34;arrColl&#34;&#62; &#60;mx:Object label=&#34;One&#34; /&#62; &#60;mx:Object label=&#34;Two&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle child recycling in a Repeater object in Flex by setting the Boolean <code>recycleChildren</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1987"></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/2009/10/08/toggling-child-recycling-on-a-repeater-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Repeater_recycleChildren_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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</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: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:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</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;Items&quot;</span></span>
<span style="color: #000000;">            status=<span style="color: #ff0000;">&quot;{arrColl.length} Items&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Repeater</span> id=<span style="color: #ff0000;">&quot;rep&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> recycleChildren=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:LinkButton</span> label=<span style="color: #ff0000;">&quot;{String(rep.currentItem.label).toUpperCase()}&quot;</span></span>
<span style="color: #000000;">                    click=<span style="color: #ff0000;">&quot;Alert.show(event.currentTarget.label);&quot;</span></span>
<span style="color: #000000;">                    width=<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:Repeater</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="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_recycleChildren_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Repeater_recycleChildren_test/bin/main.html" width="100%" height="350"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Toggling child recycling on a Repeater in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/08/toggling-child-recycling-on-a-repeater-in-flex/',contentID: 'post-1987',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'recycleChildren',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/10/08/toggling-child-recycling-on-a-repeater-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Repeater class in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 04:07:45 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[currentItem]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can use the Repeater class with Flex 4. The trick to using the Repeater class in Flex 4 is that the repeater must be within an MX container (HBox, VBox, Canvas, mx:Panel, mx:Application, etc).</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/ --&#62; &#60;s:Application name=&#34;Spark_Repeater_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#160; &#60;fx:Declarations&#62; &#60;s:ArrayList [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the Repeater class with Flex 4. The trick to using the Repeater class in Flex 4 is that the repeater must be within an MX container (HBox, VBox, Canvas, mx:Panel, mx:Application, etc).</p>
<p><span id="more-1000"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Repeater_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> id=<span style="color: #ff0000;">&quot;arrList&quot;</span></span>
<span style="color: #000000;">                source=<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;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;-- Start&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HBox</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Repeater</span> id=<span style="color: #ff0000;">&quot;r&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrList}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> left=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;335&quot;</span> label=<span style="color: #ff0000;">&quot;{r.currentItem}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Repeater</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:HBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Finish --&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Repeater_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Repeater_test/main.html" width="100%" height="150"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using the Repeater class in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/',contentID: 'post-1000',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'currentItem,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/03/10/using-the-repeater-class-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Displaying CheckBox controls using the Repeater in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/#comments</comments>
		<pubDate>Thu, 29 May 2008 13:31:53 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[currentItem]]></category>
		<category><![CDATA[getRepeaterItem()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can display a series of CheckBox controls using the Flex Repeater with an Array data provider.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/ --&#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.Alert; import mx.controls.CheckBox; private function button_click(evt:Event):void { var selArr:Array [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display a series of CheckBox controls using the Flex Repeater with an Array data provider.</p>
<p>Full code after the jump.</p>
<p><span id="more-650"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/ --&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.Alert;
            import mx.controls.CheckBox;

            private function button_click(evt:Event):void {
                var selArr:Array = [];
                var idx:int;
                var len:int = arr.length;
                for (idx=0; idx&lt;len; idx++) {
                    if (checkBox[idx].selected) {
                        selArr.push(checkBox[idx].label);
                    }
                }

                var title:String = selArr.length + " of " + len + " item(s) selected.";
                var message:String = selArr.join("\\n");
                Alert.show(message, title);
            }

            private function doFilter(element:*, index:int, arr:Array):Boolean {
                return element.selected;
            }

            private function checkBox_change(evt:Event):void {
                var ch:CheckBox = evt.currentTarget as CheckBox;
                Alert.show(ch.getRepeaterItem().data);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red" data="red" /&gt;
        &lt;mx:Object label="Orange" data="haloOrange" /&gt;
        &lt;mx:Object label="Yellow" data="yellow" /&gt;
        &lt;mx:Object label="Green" data="haloGreen" /&gt;
        &lt;mx:Object label="Blue" data="haloBlue" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:Panel id="panel" width="50%" paddingLeft="10" verticalGap="10"&gt;
        &lt;mx:Repeater id="checkBoxRepeater" dataProvider="{arr}"&gt;
            &lt;mx:CheckBox id="checkBox"
                    label="{checkBoxRepeater.currentItem.label}"
                    data="{checkBoxRepeater.currentItem.data}"
                    change="checkBox_change(event);" /&gt;
        &lt;/mx:Repeater&gt;
        &lt;mx:ControlBar horizontalAlign="right"&gt;
            &lt;mx:Button id="button"
                    label="Click me"
                    emphasized="true"
                    click="button_click(event);" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_CheckBox_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/Repeater_CheckBox_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying CheckBox controls using the Repeater in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/',contentID: 'post-650',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'currentItem,getRepeaterItem()',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/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Displaying RadioButton controls using the Repeater in Flex (redux)</title>
		<link>http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/</link>
		<comments>http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/#comments</comments>
		<pubDate>Thu, 29 May 2008 02:33:36 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[RadioButton]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[childDescriptors]]></category>
		<category><![CDATA[getRepeaterItem()]]></category>
		<category><![CDATA[initializeRepeater()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/">&#8220;Displaying RadioButton controls using the Repeater in Flex&#8221;</a>, we saw how you could use a Repeater in MXML to display a series of Flex RadioButton controls based on a data provider.</p> <p>The following example shows how you can create a Repeater using ActionScript to accomplish the same thing.</p> <p>Full code [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/">&#8220;Displaying RadioButton controls using the Repeater in Flex&#8221;</a>, we saw how you could use a Repeater in MXML to display a series of Flex RadioButton controls based on a data provider.</p>
<p>The following example shows how you can create a Repeater using ActionScript to accomplish the same thing.</p>
<p>Full code after the jump.</p>
<p><span id="more-649"></span></p>
<p class="alert">I&#8217;m not saying that creating a Repeater using ActionScript is the best/preferred/pretty way of doing this, but it is just one of many solutions.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test_2/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:comps="comps.*"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;comps:MyComp /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test_2/bin/srcview/source/comps/MyComp.as.html">comps/MyComp.as</a></p>
<pre class="code">
/**
 * http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/
 */
package comps {
    import flash.events.Event;

    import mx.containers.ApplicationControlBar;
    import mx.containers.Canvas;
    import mx.containers.Form;
    import mx.containers.FormItem;
    import mx.containers.HBox;
    import mx.controls.Alert;
    import mx.controls.Label;
    import mx.controls.RadioButton;
    import mx.controls.RadioButtonGroup;
    import mx.core.Application;
    import mx.core.Repeater;
    import mx.core.UIComponentDescriptor;
    import mx.styles.CSSStyleDeclaration;
    import mx.styles.StyleManager;

    public class MyComp extends Canvas {
        private var arr:Array;
        private var appControlBar:ApplicationControlBar;
        private var form:Form;
        private var formItem:FormItem;
        private var lbl:Label;
        private var hBox:HBox;
        private var radioGroup:RadioButtonGroup;
        private var radioRepeater:Repeater;

        public function MyComp() {
            super();
            init();
        }

        private function init():void {
            var alertCSS:CSSStyleDeclaration;
            alertCSS = StyleManager.getStyleDeclaration("Alert");
            alertCSS.setStyle("backgroundAlpha", 0.8);
            alertCSS.setStyle("backgroundColor", "black");
            alertCSS.setStyle("borderAlpha", 0.8);
            alertCSS.setStyle("borderColor", "black");

            arr = [];
            arr.push({label:"Red", data:"red"});
            arr.push({label:"Orange", data:"haloOrange"});
            arr.push({label:"Yellow", data:"yellow"});
            arr.push({label:"Green", data:"haloGreen"});
            arr.push({label:"Blue", data:"haloBlue"});

            radioGroup = new RadioButtonGroup();

            lbl = new Label();

            formItem = new FormItem();
            formItem.label = "selectedValue:";
            formItem.addChild(lbl);

            form = new Form();
            form.styleName = "plain";
            form.addChild(formItem);

            appControlBar = new ApplicationControlBar();
            appControlBar.dock = true;
            appControlBar.addChild(form);
            Application.application.addChildAt(appControlBar, 0);

            hBox = new HBox();
            hBox.setStyle("horizontalGap", 60);
            addChild(hBox);

            var descriptorProps:Object = {};
            descriptorProps.type = RadioButton;
            descriptorProps.document = this;
            descriptorProps.propertiesFactory = radioPropFac;
            descriptorProps.events = {change:"radioButton_change"};

            var radioDescriptor:UIComponentDescriptor = new UIComponentDescriptor(descriptorProps);

            radioRepeater = new Repeater();
            radioRepeater.dataProvider = arr;
            radioRepeater.childDescriptors = [radioDescriptor];
            radioRepeater.initializeRepeater(hBox, true);
        }

        private function radioPropFac():Object {
            var obj:Object = {};
            obj.label = radioRepeater.currentItem.label;
            obj.group = radioGroup;
            return obj;
        }

        public function radioButton_change(evt:Event):void {
            var radio:RadioButton = RadioButton(evt.currentTarget);
            var item:Object = radio.getRepeaterItem();
            var cssObj:CSSStyleDeclaration;
            cssObj = StyleManager.getStyleDeclaration("Alert");
            cssObj.setStyle("modalTransparencyColor", item.data);
            cssObj.setStyle("themeColor", item.data);
            Alert.show(item.label, "getRepeaterItem()");

            callLater(updateSelectedValue, [evt]);
        }

        private function updateSelectedValue(evt:Event):void {
            lbl.text = radioGroup.selectedValue.toString();
        }
    }
}
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test_2/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying RadioButton controls using the Repeater in Flex (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/',contentID: 'post-649',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'childDescriptors,getRepeaterItem(),initializeRepeater()',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/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex-redux/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Displaying RadioButton controls using the Repeater in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/#comments</comments>
		<pubDate>Wed, 28 May 2008 13:43:15 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[RadioButton]]></category>
		<category><![CDATA[RadioButtonGroup]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[getRepeaterItem()]]></category>
		<category><![CDATA[selectedValue]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can display a series of RadioButtons using the Flex Repeater with an Array data provider.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; Alert { backgroundAlpha: 0.8; backgroundColor: black; borderAlpha: 0.8; borderColor: black; } &#60;/mx:Style&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display a series of RadioButtons using the Flex Repeater with an Array data provider.</p>
<p>Full code after the jump.</p>
<p><span id="more-648"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        Alert {
            backgroundAlpha: 0.8;
            backgroundColor: black;
            borderAlpha: 0.8;
            borderColor: black;
        }
    &lt;/mx:Style&gt;

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

            private function radioButton_change(evt:Event):void {
                var radio:RadioButton = RadioButton(evt.currentTarget);
                var item:Object = radio.getRepeaterItem();
                var cssObj:CSSStyleDeclaration;
                cssObj = StyleManager.getStyleDeclaration("Alert");
                cssObj.setStyle("modalTransparencyColor", item.data);
                cssObj.setStyle("themeColor", item.data);
                Alert.show(item.label, "getRepeaterItem()");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red" data="red" /&gt;
        &lt;mx:Object label="Orange" data="haloOrange" /&gt;
        &lt;mx:Object label="Yellow" data="yellow" /&gt;
        &lt;mx:Object label="Green" data="haloGreen" /&gt;
        &lt;mx:Object label="Blue" data="haloBlue" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="selectedValue:"&gt;
                &lt;mx:Label text="{radioGroup.selectedValue}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HBox id="hb" horizontalGap="60"&gt;
        &lt;mx:RadioButtonGroup id="radioGroup" /&gt;
        &lt;mx:Repeater id="radioRepeater"
                dataProvider="{arr}"&gt;
            &lt;mx:RadioButton id="radioButtons"
                    label="{radioRepeater.currentItem.label}"
                    group="{radioGroup}"
                    change="radioButton_change(event);" /&gt;
        &lt;/mx:Repeater&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_RadioButton_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/Repeater_RadioButton_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying RadioButton controls using the Repeater in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/',contentID: 'post-648',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getRepeaterItem(),selectedValue',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/05/28/displaying-radiobutton-controls-using-the-repeater-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a pop up TitleWindow using the PopUpButton control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 05:49:42 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[PopUpButton]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[ToolBar]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can create a pop up TitleWindow container using the Flex PopUpButton 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_TitleWindow_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; TitleWindow { roundedBottomCorners: false; borderColor: haloSilver; backgroundColor: haloSilver; borderAlpha: 0.8; backgroundAlpha: 0.8; dropShadowEnabled: false; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a pop up TitleWindow container using the Flex PopUpButton control.</p>
<p>Full code after the jump.</p>
<p><span id="more-584"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        TitleWindow {
            roundedBottomCorners: false;
            borderColor: haloSilver;
            backgroundColor: haloSilver;
            borderAlpha: 0.8;
            backgroundAlpha: 0.8;
            dropShadowEnabled: false;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.CheckBox;
            import mx.controls.dataGridClasses.DataGridColumn;

            private function checkBox_change(evt:Event):void {
                var ch:CheckBox = evt.currentTarget as CheckBox;
                var idx:int = int(ch.data);
                var obj:Object = arrColl.getItemAt(idx);
                obj.sel = ch.selected;
                arrColl.disableAutoUpdate();
                arrColl.setItemAt(obj, idx);
            }

            private function selectAll(evt:Event):void {
                var idx:int;
                var item:Object;
                for (idx=0; idx&lt;arrColl.length; idx++) {
                    item = arrColl.getItemAt(idx);
                    item.sel = CheckBox(evt.currentTarget).selected;
                }
                arrColl.refresh();
            }

            private function sel_labelFunc(item:Object, col:DataGridColumn):String {
                var bool:Boolean = item.hasOwnProperty("sel") &#038;&#038;
                            (item.sel == "true" || item.sel == true);
                return bool.toString();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array id="arr"&gt;
                &lt;mx:Object label="Button" /&gt;
                &lt;mx:Object label="ButtonBar" /&gt;
                &lt;mx:Object label="CheckBox" /&gt;
                &lt;mx:Object label="ColorPicker" sel="true" /&gt;
                &lt;mx:Object label="ComboBox" sel="true" /&gt;
                &lt;mx:Object label="DataGrid" sel="true" /&gt;
                &lt;mx:Object label="DateChooser" /&gt;
                &lt;mx:Object label="DateField" sel="true" /&gt;
                &lt;mx:Object label="HorizontalList" /&gt;
                &lt;mx:Object label="HRule" /&gt;
                &lt;mx:Object label="HSlider" /&gt;
                &lt;mx:Object label="Image" /&gt;
                &lt;mx:Object label="Label" /&gt;
                &lt;mx:Object label="LinkBar" /&gt;
                &lt;mx:Object label="LinkButton" /&gt;
                &lt;mx:Object label="List" sel="true" /&gt;
                &lt;mx:Object label="Menu" /&gt;
                &lt;mx:Object label="MenuBar" /&gt;
                &lt;mx:Object label="NumericStepper" sel="true" /&gt;
                &lt;mx:Object label="ProgressBar" /&gt;
                &lt;mx:Object label="RadioButton" /&gt;
                &lt;mx:Object label="RadioButtonGroup" /&gt;
                &lt;mx:Object label="RichTextEditor" sel="true" /&gt;
                &lt;mx:Object label="Spacer" /&gt;
                &lt;mx:Object label="SWFLoader" /&gt;
                &lt;mx:Object label="TabBar" /&gt;
                &lt;mx:Object label="Text" /&gt;
                &lt;mx:Object label="TextArea" /&gt;
                &lt;mx:Object label="TextInput" /&gt;
                &lt;mx:Object label="TileList" /&gt;
                &lt;mx:Object label="Tree" sel="true" /&gt;
                &lt;mx:Object label="VideoDisplay" /&gt;
                &lt;mx:Object label="VRule" /&gt;
                &lt;mx:Object label="VScrollBar" /&gt;
                &lt;mx:Object label="VSlider" /&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:PopUpButton id="popUpButton"
                label="Please select some components"
                openAlways="true"
                close="arrColl.refresh();"&gt;
            &lt;mx:popUp&gt;
                &lt;mx:TitleWindow id="titleWin"
                        height="200"
                        showCloseButton="true"
                        verticalScrollPolicy="on"
                        horizontalScrollPolicy="off"
                        close="popUpButton.close();"&gt;
                    &lt;mx:ToolBar width="320"&gt;
                        &lt;mx:Repeater id="myRep"
                                dataProvider="{arrColl}"&gt;
                            &lt;mx:CheckBox data="{myRep.currentIndex}"
                                    label="{myRep.currentItem.label}"
                                    selected="{myRep.currentItem.sel}"
                                    change="checkBox_change(event);"
                                    width="100" /&gt;
                        &lt;/mx:Repeater&gt;
                    &lt;/mx:ToolBar&gt;
                    &lt;mx:ControlBar&gt;
                        &lt;mx:CheckBox label="Select All"
                                labelPlacement="left"
                                change="selectAll(event);" /&gt;
                    &lt;/mx:ControlBar&gt;
                &lt;/mx:TitleWindow&gt;
            &lt;/mx:popUp&gt;
        &lt;/mx:PopUpButton&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid dataProvider="{arrColl}"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="label" /&gt;
            &lt;mx:DataGridColumn dataField="sel"
                    labelFunction="sel_labelFunc" /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpButton_popUp_TitleWindow_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_TitleWindow_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a pop up TitleWindow using the PopUpButton control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/',contentID: 'post-584',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '',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/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Creating a resizing ToolBar in Flex</title>
		<link>http://blog.flexexamples.com/2008/01/06/creating-a-resizing-toolbar-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/01/06/creating-a-resizing-toolbar-in-flex/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 08:26:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Repeater]]></category>
		<category><![CDATA[ToolBar]]></category>
		<category><![CDATA[percentWidth]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/06/creating-a-resizing-toolbar-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can create a toolbar in Flex by using the ToolBar container which automatically wraps and re-lays out its children when the toolbar is resized. According to the documentation in the class file (see [SDK Directory]\frameworks\projects\framework\src\mx\controls\richTextEditorClasses\ToolBar.as):</p> <p> The ToolBar container lays out its children in a single horizontal row. If [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a toolbar in Flex by using the ToolBar container which automatically wraps and re-lays out its children when the toolbar is resized. According to the documentation in the class file (see [SDK Directory]\frameworks\projects\framework\src\mx\controls\richTextEditorClasses\ToolBar.as):</p>
<blockquote><p>
The ToolBar container lays out its children in a single horizontal row. If the width of the container is less than the measured width, the children wrap to the next line.<br />
While wrapping, any VRule controls (separators) at the end of a row or the beginning of a row are not drawn.
</p></blockquote>
<p>Full code after the jump.</p>
<p><span id="more-428"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ToolBar_percentWidth_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/06/creating-a-resizing-toolbar-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Array id="images"&gt;
        &lt;mx:Object label="Button" /&gt;
        &lt;mx:Object label="ButtonBar" /&gt;
        &lt;mx:Object label="CheckBox" /&gt;
        &lt;mx:Object label="ColorPicker" /&gt;
        &lt;mx:Object label="ComboBox" /&gt;
        &lt;mx:Object label="DataGrid" /&gt;
        &lt;mx:Object label="DateChooser" /&gt;
        &lt;mx:Object label="DateField" /&gt;
        &lt;mx:Object label="HorizontalList" /&gt;
        &lt;mx:Object label="HRule" /&gt;
        &lt;mx:Object label="HSlider" /&gt;
        &lt;mx:Object label="Image" /&gt;
        &lt;mx:Object label="Label" /&gt;
        &lt;mx:Object label="LinkBar" /&gt;
        &lt;mx:Object label="LinkButton" /&gt;
        &lt;mx:Object label="List" /&gt;
        &lt;mx:Object label="Menu" /&gt;
        &lt;mx:Object label="MenuBar" /&gt;
        &lt;mx:Object label="NumericStepper" /&gt;
        &lt;mx:Object label="ProgressBar" /&gt;
        &lt;mx:Object label="RadioButton" /&gt;
        &lt;mx:Object label="RadioButtonGroup" /&gt;
        &lt;mx:Object label="RichTextEditor" /&gt;
        &lt;mx:Object label="Spacer" /&gt;
        &lt;mx:Object label="SWFLoader" /&gt;
        &lt;mx:Object label="TabBar" /&gt;
        &lt;mx:Object label="Text" /&gt;
        &lt;mx:Object label="TextArea" /&gt;
        &lt;mx:Object label="TextInput" /&gt;
        &lt;mx:Object label="TileList" /&gt;
        &lt;mx:Object label="Tree" /&gt;
        &lt;mx:Object label="VideoDisplay" /&gt;
        &lt;mx:Object label="VRule" /&gt;
        &lt;mx:Object label="VScrollBar" /&gt;
        &lt;mx:Object label="VSlider" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="percentWidth:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="100"
                        value="35"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="10"
                        dataTipPrecision="0" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VBox id="vBox"
            verticalAlign="middle"
            horizontalAlign="center"
            backgroundColor="black"
            backgroundAlpha="0.1"
            width="100%"
            height="200"&gt;
        &lt;mx:ToolBar id="toolBar"
                 percentWidth="{slider.value}"
                 backgroundColor="haloSilver"
                 minWidth="18"&gt;
            &lt;mx:Repeater id="imgRepeater"
                    dataProvider="{images}"&gt;
                &lt;mx:Image id="img"
                        source="assets/{imgRepeater.currentItem.label}.png"
                        toolTip="{imgRepeater.currentItem.label}" /&gt;
            &lt;/mx:Repeater&gt;
        &lt;/mx:ToolBar&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ToolBar_percentWidth_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/ToolBar_percentWidth_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a resizing ToolBar in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/06/creating-a-resizing-toolbar-in-flex/',contentID: 'post-428',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'percentWidth',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/06/creating-a-resizing-toolbar-in-flex/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Displaying images from an XML file using the Repeater component</title>
		<link>http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/</link>
		<comments>http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 06:44:41 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Repeater]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Zoom]]></category>
		<category><![CDATA[completeEffect]]></category>
		<category><![CDATA[currentIndex]]></category>
		<category><![CDATA[currentItem]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/</guid>
		<description><![CDATA[<p>The following example shows you how to use the Repeater component to display images loaded from an external XML file.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_currentItem_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:XML id="imagesXML" source="images.xml" /&#62; &#60;mx:Zoom id="zoom" /&#62; &#60;mx:HBox id="hBox"&#62; &#60;mx:Repeater id="rep" dataProvider="{imagesXML.image}"&#62; &#60;mx:Image source="{rep.currentItem.@src}" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how to use the Repeater component to display images loaded from an external XML file.</p>
<p>Full code after the jump.</p>
<p><span id="more-219"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_currentItem_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="imagesXML" source="images.xml" /&gt;

    &lt;mx:Zoom id="zoom" /&gt;

    &lt;mx:HBox id="hBox"&gt;
         &lt;mx:Repeater id="rep"
                 dataProvider="{imagesXML.image}"&gt;
            &lt;mx:Image source="{rep.currentItem.@src}"
                    toolTip="{rep.currentIndex}:{rep.currentItem.@alt}"
                    completeEffect="{zoom}" /&gt;
        &lt;/mx:Repeater&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_currentItem_test/bin/data/images.xml">images.xml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/ --&gt;
&lt;images&gt;
    &lt;image src="images/Button.png" alt="Button" /&gt;
    &lt;image src="images/ButtonBar.png" alt="ButtonBar" /&gt;
    &lt;image src="images/CheckBox.png" alt="CheckBox" /&gt;
    &lt;image src="images/ColorPicker.png" alt="ColorPicker" /&gt;
    &lt;image src="images/ComboBox.png" alt="ComboBox" /&gt;
    &lt;image src="images/DataGrid.png" alt="DataGrid" /&gt;
    &lt;image src="images/DateChooser.png" alt="DateChooser" /&gt;
    &lt;image src="images/DateField.png" alt="DateField" /&gt;
&lt;/images&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Repeater_currentItem_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/Repeater_currentItem_test/bin/main.html" width="100%" height="100"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying images from an XML file using the Repeater component on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/',contentID: 'post-219',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'completeEffect,currentIndex,currentItem',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/10/03/displaying-images-from-an-xml-file-using-the-repeater-component/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

