Flash random image
Flash random image
Out of context: Reply #13
- Started
- Last post
- 18 Responses
- unfittoprint0
//number of images
n = 25;//REFRESH
function refresh(n) {
images = new Array();
for (i=0; i < n; i++) {
images[i] = (i+1)+".jpg";
}
randimages = new Array();
}//Make Rand
function makeRand() {
if (images.length == 0 || images == undefined) {
refresh(n);
}
rand = Math.floor(Math.random()*images...
_root.pic.loadMovie("pics/"+imag...
//Backup
randimages.push(images[rand]);
//remove image
images.splice(rand, 1);
//Restart/Refresh
}
//usage for button
trigger.onPress = function() {
makeRand(n);
};
//or usage for frame
makeRand(n);