# Object sort

**URL:** <https://forum.kirupa.com/t/object-sort/279868>\
**Category:** flash\
**Created:** [January 20, 2009, 4:39am UTC](https://forum.kirupa.com/t/object-sort/279868 "2009-01-20T04:39:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfsiddiq](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mfsiddiq](https://forum.kirupa.com/u/mfsiddiq)\
**Post date:** [January 20, 2009, 4:39am UTC](https://forum.kirupa.com/t/object-sort/279868/1 "2009-01-20T04:39:59Z")

</div>

i am sorting an arrayCollection and then adding the sorted collection as object variables.But the object is getting sorted by default in the ascending order of the variable name

for eg i have a collection like this coll[{[6]:30},{[4]:39},{[8]:45},{[5]:50}] which is sorted in ascending order of the values.

i want to add this name value pair to an object  
var obj:Object=new Object()  
for(var i:int=0;i\<coll.length().i++)  
{  
obj[coll[0].name]=coll[0].value

}  
But the object gets sorted in ascending order based on the name  
like this obj[4]  
obj[5]  
obj[6] and so on  
How can i display the object variables in the order they were added.
