I am not sure if there is a sort method for arrays such as
Array.Sort(direction) if such a function does not exists then you can always
write a quick bubble sort function.
function bubblesort(ArrayName){
changesmade = true;
for(y = 0; y ArrayName.Length; y++{
The array class in Flash has a sort numeric (least to greatest) feature:
var myArray:Array = new Array();
myArray.push(5);
myArray.push(1);
myArray.push(65);
myArray.push(3);
myArray.push(56);
myArray.push(9);
myArray.push(-2);
myArray.push(44);
myArray.push(7);
myArray.push(8);
thanks for all the help guys. I am going to play with sort and see if I
can't get this to work.
On 7/6/07, Steve Abaffy [EMAIL PROTECTED] wrote:
I am not sure if there is a sort method for arrays such as
Array.Sort(direction) if such a function does not exists then you can
always
write a quick
Hey
You can push the numbers by using Array.push(The number). After that if you
need to arrange that elements in a array you need to sort that array using
array. sort(2) where 2 is the options number for sorting which represents
descending
Durai
www.expertbuddy.net
-Original Message-
Assuming you have something like this:
var list:String = 7,60,5,9,11,13,1;
var listArr:Array = list.split(,);
listArr.sort();
That should do it.
On 7/6/07, Corban Baxter [EMAIL PROTECTED] wrote:
Hey all I have a list of 10 numbers that I need to push into and array
from
least to greatest
Put them in the array as is and then use Array.Sort()?
Dave
From: Corban Baxter [EMAIL PROTECTED]
Reply-To: flashcoders@chattyfig.figleaf.com
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] least to greatest
Date: Fri, 6 Jul 2007 08:50:20 -0500
Hey all
6 matches
Mail list logo