Posted By

fergc on 02/07/13


Tagged

as3


Versions (?)

Vector sorton


 / Published in: ActionScript 3
 

Ordenar vector as3

  1. vector = = Vector.<String>(sortOn(vector "id", Array.NUMERIC));
  2.  
  3. private function vectorToArray(vector:*):Array
  4. {
  5. var n:int = vector.length;
  6. var a:Array = new Array();
  7. for(var i:int = 0; i < n; i++) a[i] = vector[i];
  8. return a;
  9. }
  10.  
  11. private function sortOn(vector:*, fieldName:Object, options:Object = null):Array
  12. {
  13. return vectorToArray(vector).sortOn(fieldName, options);
  14. }

Report this snippet  

You need to login to post a comment.