I got a preloader to work perfectly on my local server, there is the perfect little percentage marker and a nice fade in, however, when I post it online the files are being downloaded too quickly, or not really at all. They don’t even seem to be being preloaded even though the preload loadlistener shows a scale from 0 to 100 percent.
Could someone look at my code and at the site and see what’s going on? I am almost at the end of this project and would love to move on to the more exciting stuff!
Thanks in advance.
www.inadequateanimal.com/index2.html
This is the code for one of the four preloaders (one for each quadrant):
filename = [“01.jpg”, “02.jpg”, “03.jpg”, “04.jpg”, “05.jpg”, “06.jpg”, “07.jpg”, “08.jpg”, “09.jpg”];
path = “http://www.inadequateanimal.com/pictures/topleft/”;
i = filename.length;
k = Math.floor(Math.random()*i);
this.onEnterFrame = function() {
startLoading(path+filename[k]);
infoField._visible = true;}
function startLoading(whichImage) {
loadMovie(whichImage, topleftloader);
this.onEnterFrame = function() {
infoLoaded = topleftloader.getBytesLoaded();
infoTotal = topleftloader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
infoField._visible = false;
this.gotoAndStop(2);
}
};
}
stop();
It works perfectly on the local server, even when downloading each image from the url. When posted to the index2.html there is no pause as files are completely loaded… just a flickering 100% and then an image that pops up a little late!