<?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; fields</title>
	<atom:link href="http://blog.flexexamples.com/tag/fields/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>Displaying the sort arrow in a Flex DataGrid control without having to click a column</title>
		<link>http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/</link>
		<comments>http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 01:38:07 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Sort]]></category>
		<category><![CDATA[SortField]]></category>
		<category><![CDATA[fields]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/</guid>
		<description><![CDATA[<p>I&#8217;ve seen this question come up a few times recently in various forums/lists and even in my blog comments (see <a href="http://blog.flexexamples.com/2008/02/23/changing-the-default-sort-arrow-skin-on-a-flex-datagrid-control/">&#8220;Changing the default sort arrow skin on a Flex DataGrid control&#8221;</a>).</p> <p>The following example shows how you can display the sort arrow in a DataGrid control in Flex without having the user click on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen this question come up a few times recently in various forums/lists and even in my blog comments (see <a href="http://blog.flexexamples.com/2008/02/23/changing-the-default-sort-arrow-skin-on-a-flex-datagrid-control/">&#8220;Changing the default sort arrow skin on a Flex DataGrid control&#8221;</a>).</p>
<p>The following example shows how you can display the sort arrow in a DataGrid control in Flex without having the user click on a column header in the DataGrid control.</p>
<p>Full code after the jump.</p>
<p><span id="more-534"></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/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_dataProvider_sort_fields_test&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.collections.Sort;</span>
<span style="color: #339933;">            import mx.collections.SortField;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                arrColl.sort = new Sort();</span>
<span style="color: #339933;">                arrColl.sort.fields = [new SortField(&quot;idx&quot;, false, true)];</span>
<span style="color: #339933;">                arrColl.refresh();</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: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> idx=<span style="color: #ff0000;">&quot;1&quot;</span> c1=<span style="color: #ff0000;">&quot;One.1&quot;</span> c2=<span style="color: #ff0000;">&quot;One.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;2&quot;</span> c1=<span style="color: #ff0000;">&quot;Two.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Two.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;3&quot;</span> c1=<span style="color: #ff0000;">&quot;Three.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Three.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;4&quot;</span> c1=<span style="color: #ff0000;">&quot;Four.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Four.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;5&quot;</span> c1=<span style="color: #ff0000;">&quot;Five.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Five.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;6&quot;</span> c1=<span style="color: #ff0000;">&quot;Six.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Six.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;7&quot;</span> c1=<span style="color: #ff0000;">&quot;Seven.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Seven.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;8&quot;</span> c1=<span style="color: #ff0000;">&quot;Eight.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Eight.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;9&quot;</span> c1=<span style="color: #ff0000;">&quot;Nine.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Nine.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;10&quot;</span> c1=<span style="color: #ff0000;">&quot;Ten.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Ten.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;11&quot;</span> c1=<span style="color: #ff0000;">&quot;Eleven.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Eleven.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;12&quot;</span> c1=<span style="color: #ff0000;">&quot;Twelve.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Twelve.2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> idx=<span style="color: #ff0000;">&quot;13&quot;</span> c1=<span style="color: #ff0000;">&quot;Thirteen.1&quot;</span> c2=<span style="color: #ff0000;">&quot;Thirteen.2&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>
        <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:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;idx&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</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/DataGrid_dataProvider_sort_fields_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/DataGrid_dataProvider_sort_fields_test/bin/main.html" width="100%" height="220"></iframe></p>
<p>A big thanks to Rob for the heads up with the solution!</p>
<p>For more information, see <a href="http://bugs.adobe.com/jira/browse/SDK-14663">http://bugs.adobe.com/jira/browse/SDK-14663</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying the sort arrow in a Flex DataGrid control without having to click a column on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/',contentID: 'post-534',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fields',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/28/displaying-the-sort-arrow-in-a-flex-datagrid-control-without-having-to-click-a-column/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Sorting XML documents using an XMLListCollection</title>
		<link>http://blog.flexexamples.com/2007/12/04/sorting-xml-documents-using-an-xmllistcollection/</link>
		<comments>http://blog.flexexamples.com/2007/12/04/sorting-xml-documents-using-an-xmllistcollection/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 07:41:08 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Sort]]></category>
		<category><![CDATA[SortField]]></category>
		<category><![CDATA[XMLListCollection]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[reverse()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/04/sorting-xml-documents-using-an-xmllistcollection/</guid>
		<description><![CDATA[<p>The following example shows how you can sort an XML document by converting it into an XMLListCollection and applying a sort. You can also easily reverse the current sort by calling the SortField object&#8217;s reverse() method and refreshing the XMLListCollection object.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/XMLListCollection_sort_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can sort an XML document by converting it into an XMLListCollection and applying a sort. You can also easily reverse the current sort by calling the SortField object&#8217;s <code>reverse()</code> method and refreshing the XMLListCollection object.</p>
<p>Full code after the jump.</p>
<p><span id="more-351"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/XMLListCollection_sort_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/12/04/sorting-xml-documents-using-an-xmllistcollection/ --&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.utils.StringUtil;

            private function list_labelFunc(item:Object):String {
                return StringUtil.substitute("{0} {1} ({2} {3})",
                        item.@label, // city
                        item.@name, // name
                        item.parent().parent().@abbrev, // league
                        item.parent().@label); // division
            }

            private function checkBox_click(evt:MouseEvent):void {
                sortField.reverse();
                xmlListColl.refresh();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

    &lt;mx:XMLListCollection id="xmlListColl"
            source="{mlb.league.division.team}"&gt;
        &lt;mx:sort&gt;
            &lt;mx:Sort&gt;
                &lt;mx:fields&gt;
                    &lt;mx:SortField id="sortField"
                            name="@label"
                            caseInsensitive="true" /&gt;
                &lt;/mx:fields&gt;
            &lt;/mx:Sort&gt;
        &lt;/mx:sort&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="reverse()"
                labelPlacement="left"
                click="checkBox_click(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:List id="list"
            dataProvider="{xmlListColl}"
            labelFunction="list_labelFunc"
            width="300"
            rowCount="8" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/XMLListCollection_sort_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/XMLListCollection_sort_test/bin/main.html" width="100%" height="280"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Sorting XML documents using an XMLListCollection on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/04/sorting-xml-documents-using-an-xmllistcollection/',contentID: 'post-351',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fields,reverse()',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/12/04/sorting-xml-documents-using-an-xmllistcollection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sorting an ArrayCollection using the SortField and Sort classes</title>
		<link>http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/</link>
		<comments>http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 15:18:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[Sort]]></category>
		<category><![CDATA[SortField]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[refresh()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/</guid>
		<description><![CDATA[<p>Sometimes in life you just need data to be sorted. Whether its a case insensitive sort (for names) or a numeric sort (for, uh, numbers), you just want things sorted in a particular order.</p> <p>This example demonstrates how you can take a bunch of random numbers in an ArrayCollection and sort them numerically in ascending [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes in life you just need data to be sorted. Whether its a case insensitive sort (for names) or a numeric sort (for, uh, numbers), you just want things sorted in a particular order.</p>
<p>This example demonstrates how you can take a bunch of random numbers in an ArrayCollection and sort them numerically in ascending order.</p>
<p><span id="more-56"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ArrayCollection_sort_test/bin/srcview/ArrayCollection_sort_test.zip">Download source (ZIP, 1K)</a> | <a href="http://blog.flexexamples.com/wp-content/uploads/ArrayCollection_sort_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: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;vertical&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span> creationComplete=<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.SortField;</span>
<span style="color: #339933;">            import mx.collections.Sort;</span>
<span style="color: #339933;">            import mx.collections.ArrayCollection;</span>
&nbsp;
<span style="color: #339933;">            [Bindable]</span>
<span style="color: #339933;">            private var arrColl:ArrayCollection;</span>
&nbsp;
<span style="color: #339933;">            /** This method gets called by the main mx:Application tag and initializes/populates the ArrayCollection object with a bunch of random numbers. */</span>
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                var i:int;</span>
&nbsp;
<span style="color: #339933;">                /* Initialize and populate the ArrayCollection object. */</span>
<span style="color: #339933;">                arrColl = new ArrayCollection();</span>
<span style="color: #339933;">                for (i = 0; i &lt; 20; i++) {</span>
<span style="color: #339933;">                    arrColl.addItem({data:getRandomNumber().toFixed(4)});</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            /** This method returns a random floating-point number between 0 and 10000. */</span>
<span style="color: #339933;">            private function getRandomNumber():Number {</span>
<span style="color: #339933;">                return Math.random() * 10000;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            /** This method gets called by the Button control's click handler and creates a new SortField and Sort object which are used to sort the ArrayCollection. */</span>
<span style="color: #339933;">            private function button_click():void {</span>
<span style="color: #339933;">                /* Create the SortField object for the &quot;data&quot; field in the ArrayCollection object, and make sure we do a numeric sort. */</span>
<span style="color: #339933;">                var dataSortField:SortField = new SortField();</span>
<span style="color: #339933;">                dataSortField.name = &quot;data&quot;;</span>
<span style="color: #339933;">                dataSortField.numeric = true;</span>
&nbsp;
<span style="color: #339933;">                /* Create the Sort object and add the SortField object created earlier to the array of fields to sort on. */</span>
<span style="color: #339933;">                var numericDataSort:Sort = new Sort();</span>
<span style="color: #339933;">                numericDataSort.fields = [dataSortField];</span>
&nbsp;
<span style="color: #339933;">                /* Set the ArrayCollection object's sort property to our custom sort, and refresh the ArrayCollection. */</span>
<span style="color: #339933;">                arrColl.sort = numericDataSort;</span>
<span style="color: #339933;">                arrColl.refresh();</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:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> textAlign=<span style="color: #ff0000;">&quot;right&quot;</span> labelField=<span style="color: #ff0000;">&quot;data&quot;</span> width=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;button&quot;</span> label=<span style="color: #ff0000;">&quot;sort items&quot;</span> click=<span style="color: #ff0000;">&quot;button_click()&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">View source is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ArrayCollection_sort_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Sorting an ArrayCollection using the SortField and Sort classes on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/',contentID: 'post-56',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fields,refresh()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
	</channel>
</rss>

