I’ve want to display 2 random images on the same page from a directory that has 5 images in it.
I got the random part, but I can’t get the pics to load simultaneously. Can someone point out what I did wrong?
Array.prototype.pickRandomValues = function(n) {
var selected = [];
for (var i = 0; i<n; ++i) {
var r = Math.floor(Math.random()*this.length);
selected.push(this[r]);
this.splice(r, 1);
}
return selected;
};
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc");
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc copy");