I’m trying to implement onSort() function in actionscript2 regarding the criteria city (so I want to use onSort() by city criteria. My array name is vecteur that is included in class Array) .
here is the code:
var vecteur = new Array();
vecteur.push( { name: "bob", city: "omaha", zip: 68144 } );
vecteur.push( { name: "greg", city: "kansas city", zip: 72345 } );
vecteur.push( { name: "chris", city: "burlingame", zip: 94010 } );
vecteur.sortOn("city");
I want that he displays me this:
vec[0] = name: "chris", city: "burlingame", zip: 94010
vec[1] = name: "greg", city: "kansas city", zip: 72345
vec[2] = name: "bob", city: "omaha", zip: 68144
He is displaying: [objet]…[objet]
Any ideas please?