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 PM
To: flexcoders@yahoogroups.com
Subject: 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 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Sort Array of object

 

http://livedocs.macromedia.com/flex/15/flex_docs_en/00001201.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 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

Reply via email to