RE: [flexcoders] Sort Array of object

2005-04-11 Thread Gordon Smith
Title: Message





sortOn() will be faster than sort() with a 
compareFunc.

- 
Gordon

  
  -Original Message-From: Jeff Krueger 
  [mailto:[EMAIL PROTECTED] Sent: Sunday, April 10, 2005 6:38 
  PMTo: flexcoders@yahoogroups.comSubject: RE: 
  [flexcoders] Sort Array of object
  
  Thanks, compareFunc 
  did the trick.
  
  Jeff
  
  
  
  
  
  
  From: Matt 
  Chotin [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 8:33 
  PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Sort Array of 
  object
  
  http://livedocs.macromedia.com/flex/15/flex_docs_en/1201.htm
  
  Array.sortOn is what you're looking for I think. 
  Array.sort will take a compareFunc if you want to do something more 
  complex.
  
  Matt
  
  
  
  
  
  From: Jeff 
  Krueger [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 6:59 
  PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Sort Array of 
  object
  
  Hello,
  
   
  Is there a way to sort and array of objects. So for example I have and 
  array of a class
  
  class 
  test
  {
   
  public var A:String;
   
  public var 
  B:String;
   
  public var C:String;
  }
  
  And I want to sort the array by 
  the value in the variable B.
  
  arrayInstance.sort("test.B",Array.Descending);
  or
  arrayInstance.sort("B",Array.Descending);
  
  Neither seem to work for me, is 
  this not possible?
  
  Thanks
  
  
  Jeff 
  







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Sort Array of object

2005-04-10 Thread Jeff Krueger










Thanks, compareFunc did the trick.



Jeff













From: Matt Chotin
[mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 8:33
PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Sort
Array of object





http://livedocs.macromedia.com/flex/15/flex_docs_en/1201.htm



Array.sortOn is what youre looking for I think. Array.sort
will take a compareFunc if you want to do something more complex.



Matt











From: Jeff Krueger
[mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 6:59
PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Sort Array
of object





Hello,




Is there a way to sort and array of objects. So for example I have and
array of a class



class test

{


public var A:String;


public var B:String;


public var C:String;

}



And I want to sort the array by the value in the variable B.



arrayInstance.sort(test.B,Array.Descending);

or

arrayInstance.sort(B,Array.Descending);



Neither seem to work for me, is this not possible?



Thanks





Jeff 













Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.