# sortOn() multiple fields with different options

**URL:** <https://forum.kirupa.com/t/sorton-multiple-fields-with-different-options/137231>\
**Category:** Uncategorized\
**Created:** [February 12, 2005, 11:49am UTC](https://forum.kirupa.com/t/sorton-multiple-fields-with-different-options/137231 "2005-02-12T11:49:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinKool](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@MartinKool](https://forum.kirupa.com/u/MartinKool)\
**Post date:** [February 12, 2005, 11:49am UTC](https://forum.kirupa.com/t/sorton-multiple-fields-with-different-options/137231/1 "2005-02-12T11:49:07Z")

</div>

Hey,

I did a quick search of the forums but couldn’t find much on this issue. I get the feeling this problem is anything but complex, but I can’t seem to pull it off.

I have an array that contains search results and looks like this:

array[x].id :Number  
array[x].sectionID :Number  
array[x].occur :Number  
array[x].title :String  
etc…

I want to sort it by sectionID ASC and occur DESC (occurances). What I read in the documentation is that I can sort on multiple fields like so:

array.sortOn([“sectionID”, “occur”], _options_);

But I need to specify different options for each fieldName while it seems the function only allows for one set of options. Any idea how I can get this done? Thank in advance.

btw: I’m using Flash MX2004
