Hi everyone,

I was wondering if you could help me please.

I have the following multidimensional array:

Code:
var bestSize:Array = new Array();
	bestSize.push( { counter: small, order: "1", productSize: "S" } );
	bestSize.push( { counter: medium, order: "2", productSize: "M" } );
	bestSize.push( { counter: large, order: "3", productSize: "L" } );
	bestSize.push( { counter: xlarge, order: "4", productSize: "XL" } );
	bestSize.push( { counter: xxlarge, order: "5", productSize: "XXL" } );
I want to first of all sort the array in descending order on "counter". I then want to perform a sub sort on "order" to arrange the values in ascending order. I can peform the first sort by doing...

Code:
bestSize.sortOn("counter", Array.DESCENDING)
...or by creating the following function...

Code:
function sortBySizeCounter(counterValue1, counterValue2)
	{
		var a, b;
		a = counterValue1["counter"]
		b = counterValue2["counter"]
		if (a > b) 
		{
			return -1;
		} 
		else if (b > a)
		{
			return 1;
		}
		else 
		{
			return 0
		}
	}
	bestSize.sort(sortBySizeCounter);
I would like to know if somebody could suggest a way in which I could perform the required sub sort.

I am fairly new to ActionScript so apologise if this sounds like a dumb question.

Thank you in advance for your help with this.

Kind Regards,

Joe