# sortOn (multiple values)

**URL:** <https://forum.kirupa.com/t/sorton-multiple-values/177365>\
**Category:** flash\
**Created:** [February 1, 2006, 9:36am UTC](https://forum.kirupa.com/t/sorton-multiple-values/177365 "2006-02-01T09:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewi\_p](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@lewi\_p](https://forum.kirupa.com/u/lewi_p)\
**Post date:** [February 1, 2006, 9:36am UTC](https://forum.kirupa.com/t/sorton-multiple-values/177365/1 "2006-02-01T09:36:08Z")

</div>

Hi

I’m trying to use the sortOn method to sort through two sets of values…I can get it working with one value find but I dont know how to add another.

For example…say I have 4 teams with 2values each:

Team1 - Value A=3, Value B=10  
Team2 - Value A=6, Value B=2  
Team3 - Value A=1, Value B=3  
Team4 - Value A=1, Value B=6

I want to be able to sort through all “A” values first but if two are the same (like Team3 &Team4) I want to be able to go to the next value (B) and use that to sort them…so when the results come back I get.

Team2 - Value A=6, Value B=2  
Team1 - Value A=3, Value B=10  
Team4 - Value A=1, Value B=6  
Team3 - Value A=1, Value B=3

Below is what I think it could be but it doesnt work ☹

```auto
 
this.createEmptyMovieClip("team1", 1).prop = 3.goal = 10;
this.createEmptyMovieClip("team2", 2).prop = 6.goal = 2;
this.createEmptyMovieClip("team3", 3).prop = 1.goal = 3;
this.createEmptyMovieClip("team4", 4).prop = 1.goal = 6;
var arr:Array = new Array({mc:team1box, prop:team1.prop, goal:team1.goal}, {mc:team2box, prop:team2.prop, goal:team2.goal}, {mc:team3box, prop:team3.prop, goal:team3.goal}, {mc:team4box, prop:team4.prop, goal:team4.goal});
arr.sortOn("prop", Array.NUMERIC) && ("goal", Array.NUMERIC);

```
