gencoglu
01-17-2009, 10:37 AM
:confused:Hi,
I have 20 rectangle shaped movie clips.m1,m2,m3,...m20,I want to display only 5 of them randomly.and the NCs should be unique(no dublications) need to change their _y position randomly everytime clciking a button..but there must be 10px space between them... so how do I modify the code to do it ?
thanks
myArray = new Array(m1, m2, m3, m4, m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20);
for (i=0; i<=myArray.length; i++) {
_root["m"+i]._x=400;
_root["m"+i]._y=Math.floor(Math.random()*300)+20;
}
I have 20 rectangle shaped movie clips.m1,m2,m3,...m20,I want to display only 5 of them randomly.and the NCs should be unique(no dublications) need to change their _y position randomly everytime clciking a button..but there must be 10px space between them... so how do I modify the code to do it ?
thanks
myArray = new Array(m1, m2, m3, m4, m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20);
for (i=0; i<=myArray.length; i++) {
_root["m"+i]._x=400;
_root["m"+i]._y=Math.floor(Math.random()*300)+20;
}