Hi guys, help me please!
I would like to make an array with some objects, let’s say something like this:
var berry = new Object;
berry.color = "purple";
berry.taste = "good";
var orange = new Object;
orange.color = "orange";
orange.taste = "acid";
var strawberry = new Object;
strawberry.color = "red";
strawberry.taste = "sweet";
var fruit_array:Array = new Array(berry, orange, strawberry);
for(var i=0; i<3; i++){
trace(fruit_array*.color +" - "+ fruit_array*.taste);
}
And now I would to trace the whole array, but sorted by color of the fruit or taste. Is it possible? If yes, how? Thanks a bunch for ideas, opinions, etc.
Poco