var array = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];
var array2 = [].concat(array);
array2.sort ( function (){ return Math.round(Math.random()); } );
trace( array ); // 0,1,2,3,4,5,6,7,8,9
trace( array2 ); // 8,2,3,6,5,4,1,7,0,9
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of natalia
Vikhtinskaya
Sent: Monday, August 13, 2007 2:29 AM
To: Flashcoders mailing list
Subject: [Flashcoders] array copy with random order
Hi
I have one Array with random numbers [40,32,90,76,66]
I need copy of this array but the order should be different and random.
Something like this: [76,90,40,32,66]. How can this be done?
Thanks for any help.
_______________________________________________
[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
_______________________________________________
[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