title: How to sort an ArrayCollection in Flex
body: <p>I want to sort an Arraycollection by fieldName as ascending. Here's my code and I want to know whether it's right. Do you have any suggestions?</p>
  
  <pre><code>public static function arrayCollectionSort(ar:ArrayCollection, fieldName:String, isNumeric:Boolean):void 
      {var dataSortField:SortField = new SortField();
          dataSortField.name = fieldName;
          dataSortField.numeric = isNumeric;
          var numericDataSort:Sort = new Sort();
          numericDataSort.fields = [dataSortField];
          arrCol.sort = numericDataSort;
          arrCol.refresh();}
  </code></pre>