title: AS3 - Sorting an array of nested arrays
body: <p>How would I go about sorting an array of nested arrays, based on the contents of one of the nested arrays elements?</p>
  
  <pre><code>var nestedArray1:Array = new Array(0,0,1);
  var nestedArray2:Array = new Array(0,0,9);
  var nestedArray3:Array = new Array(0,0,7);
  var nestedArray4:Array = new Array(0,0,3);
  
  var parentArray:Array = new Array(nestedArray1,nestedArray2,nestedArray3,nestedArray4);
  </code></pre>
  
  <p>I would like to end up with an array sorted using the nested arrays 3rd element.</p>
  
  <p>So tracing sortedParentArray would give me:
  0,0,1,0,0,3,0,0,7,0,0,9</p>
  
  <p>which is nestedArray1, nestedArray4, nestedArray3, nestedArray2</p>
  
  <p>Thanks,</p>
  
  <p>Mark</p>