# sortOn array field?

**URL:** <https://forum.kirupa.com/t/sorton-array-field/250204>\
**Category:** flash\
**Created:** [January 26, 2008, 9:08pm UTC](https://forum.kirupa.com/t/sorton-array-field/250204 "2008-01-26T21:08:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zforest](https://avatars.discourse-cdn.com/v4/letter/z/d26b3c/32.png) [@zforest](https://forum.kirupa.com/u/zforest)\
**Post date:** [January 26, 2008, 9:08pm UTC](https://forum.kirupa.com/t/sorton-array-field/250204/1 "2008-01-26T21:08:04Z")

</div>

Hello,

I’ve used sortOn many times before, but have never used to to sort by a field in an array. What I mean is this:

Say I have an array of objects:  
myArray.object1  
myArray.object2  
…myArray.object10

And each object in the array contains an array of values:  
myArray.object1.anotherarray[0…10]

Why can’t I use sortOn to sort the first array (myArray) based on an array field in ‘anotherarray’?

I would think it would just work like this:  
myArray.sortOn(“anotherarray[0]”, Array.NUMERIC);

But that doesn’t work. Any ideas? Shouldn’t this be a pretty basic sort?

Thanks,

Zach
