I have an Array which has Class instances in it. These class instances have several properties. Let's say I want to sort this array by the name property of each instance.
public class Thing
{
public var name:String;
public function Thing(name:String)
{
this.name = name;
}
}
And here is what the Array might look like:
var ar:Array = new Array(new Thing("Apple"), new Thing("Compass"),
new Thing("Banana"), new Thing("Alligator"));
After sorting it and looping through it to trace each instance's name property, it should output like this: Alligator, Apple, Banana, Compass