I’ve got 2 arrays that I want to randomize together. So if array one (1,2,3,4,5) is randomized to be (5,2,3,4,1), how can I have the second array randomize to that order?
///Here’s my randomize function///
Array.prototype.rn= function()
{
ret= new Array();
var copy= this.concat();
while(copy.length > 0)
{
rnd=int(Math.random()*copy.length)
ret.push(copy[rnd])
copy.splice(rnd,1);
}
return ret
}
///Here’s me calling the first array to be random///
b=zArray.rn();
how can I say “make the xArray correspond with the random order of the zArray” with AS?
Thanks
Igby