Hi, I'm trying to create a function that saves a vector that represents time, or several instances of time in this case, and for each instance it holds a vector of several positions (x,y) of several objects. For some reason when I run it the first alert gives me the results as I want them but then of the last alerts it just gives me same result (on the 3) and is the last one that run through the while. It's like it's only saving the last entry. What am I doing wrong? Thank you and sorry for my bad English.

function randomNumbers(){
i=0;
while (i<=tRight-1){
w=0;
while(w<=Numb_lights-1){
x=Math.round(Math.random()*5)*100+307;
y=Math.round(Math.random()*2)*150+95;
valoresx[w]=x;
valoresy[w]=y;
w=w+1;
}
valores[0]=valoresx;
valores[1]=valoresy;
valorest=new Array();
valorest=valores;
alert(valorest
);
i=i+1;
}
alert(valorest[0][0]);
alert(valorest[1][0]);
alert(valorest[2][0]);
alert(valorest[3][0]);
}