Random loading modificering af script
Kan man modificerer dette script til at loade et random billede?Altså et billede mellem nummer 1 (num) og X angivet antal (max).
num = 1;
max = 10;
function setString(num) {
i = 'content/random/images/'+num+'.jpg';
}
setString(num);
function preload (){
preloadBar._alpha = 100;
imageLoaded = false;
preloadBar._xscale = loadedBytes = totalBytes = percent = 0;
this.onEnterFrame = function(){
totalBytes = ImageHolder.getBytesTotal();
loadedBytes = ImageHolder.getBytesLoaded();
percent = Math.floor(loadedBytes/totalBytes*100);
if(totalBytes > 4) preloadBar._xscale = percent;
if(!imageLoaded && loadedBytes == totalBytes && totalBytes > 4){
imageLoaded = true;
preloadBar._alpha = 0;
}
}
}
loadMovie((i), "ImageHolder");
preload()
stop();
