Description
Sorts the array in place, without making a copy. If the compareFunction parameter has not been specified, Ffish Script sorts the elements in place using the "<" comparison operator.
Syntax
array1.sort([compareFunction])
Parameters
Returns
Nothing.
Example
function sortfunc(a, b)
{
num1 = parseInt(a.substr(1));
num2 = parseInt(b.substr(1));
return num1 - num2;
}
a = ["a0", "a1", "a11",
"a2", "a21", "a3", "a31"];
a.sort(sortfunc);
trace(a);
//output: a0,a1,a2,a3,a11,a21,a31