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
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);