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);
myArray.push(10);
trace("myArray: " + myArray); // myArray: 5,1,65,3,56,9,-2,44,7,8,10
myArray.sort(Array.NUMERIC );
trace("myArray: " + myArray); // myArray: -2,1,3,5,7,8,9,10,44,56,65
Would this work, or do you need to have the numbers pushed onto the
array in a specific order to begin with?
Daniel Holth
I.S. Programmer
x5217 || J401
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Corban
Baxter
Sent: Friday, July 06, 2007 8:50 AM
To: Flashcoders mailing list
Subject: [Flashcoders] least to greatest
Hey all I have a list of 10 numbers that I need to push into and array
from
least to greatest fairly often. What would be the fastest way to get
this
accomplished? Or maybe just anyway to get this done would be a great
help
thanks.
--
Corban Baxter
http://www.projectx4.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
This e-mail and its attachments are intended only for the use of the
addressee(s) and may contain privileged, confidential or proprietary
information. If you are not the intended recipient, or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution, displaying, copying, or
use of this information is strictly prohibited. If you have received this
communication in error, please inform the sender immediately and delete and
destroy any record of this message. Thank you.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com