Posted By

tuffstudio on 01/19/11


Tagged


Versions (?)

Who likes this?

10 people have marked this snippet as a favorite

kojok
burnandbass
liakwee
kure69
onemanstudio
merritt212
Fakeham
shalomfriss
timr
dstrystudio


Randomize an Array


 / Published in: ActionScript 3
 

  1. for (var i:uint = 0; i < myArray.length; i++)
  2. {
  3. var rand:uint = int(Math.random() * myArray.length);
  4. myArray.push( myArray.splice( rand, 1 )[0] );
  5. }

Report this snippet  

You need to login to post a comment.