There are some problems with your code. you don't need to do anything complicated like overwrite sortOn.
What you need to do is use sort with a sortFuntion. I can't write specific code for you at the moment but here is an example of some code I wrote last week sorting on multiple fields.
It will group together objects with the same y value and then whithin those groups it will sort on x1.
ActionScript Code:
someData =
[
{x1:43, y:205},
{x1:-9, y:225},
{x1:225, y:225},
{x1:36, y:245},
{x1:-9, y:265},
{x1:44, y:285},
{x1:165, y:285},
{x1:118, y:305},
{x1:-9, y:285}
];
someData.sort(this.mySort);
function mySort(a, b)
{
ay = a.y;
ax = a.x1;
by = b.y;
bx = b.x1;
if(ay < by)
{
return -1;
}
else if(ay > by)
{
return 1;
}
else
{
if(ax < bx)
{
return -1;
}
else if(ax > bx)
{
return 1;
}
else
{
return 0;
}
}
}
The code that matters is what's inside the mySort function.
1) if you want 'a' to show up before 'b' then return -1
2) if you want 'a' to show up after 'b' then return 1
3) and if 'a' and 'b' are the same return 0
I'd recomend reading up on Array.sort in the as dictionary. It gives a pretty good explanation.
Cheers,
Rich