# Possible to sort Objects in array?

**URL:** <https://forum.kirupa.com/t/possible-to-sort-objects-in-array/181952>\
**Category:** flash\
**Created:** [March 14, 2006, 3:07pm UTC](https://forum.kirupa.com/t/possible-to-sort-objects-in-array/181952 "2006-03-14T15:07:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poco](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Poco](https://forum.kirupa.com/u/Poco)\
**Post date:** [March 14, 2006, 3:07pm UTC](https://forum.kirupa.com/t/possible-to-sort-objects-in-array/181952/1 "2006-03-14T15:07:37Z")

</div>

Hi guys, help me please!  
I would like to make an array with some objects, let’s say something like this:

```auto

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
