Preloader; so close and yet so far

Hey everyone. It seems like only yesterday but I am plotting a new site and this time i’d like the preloader to … well … function properly. Since I am involved, that would be asking too much. Thats where the ever-helpful Kirupa comes in … hopefully.

Currently I am using the following code for my preloader:

[COLOR=DarkRed][SIZE=1]
this.createEmptyMovieClip(“preloader”, 1000);
this.createEmptyMovieClip(“container”, 1001);

myIdentifier=Math.round(Math.random()*10000);
container.loadMovie(“http://www.enorme.org/peterson/pic14.jpg?uniq=”+myIdentifier);

container._visible = false;

preloader.onEnterFrame = function() {
var l = container.getBytesLoaded();
var t = container.getBytesTotal();
if (l>0 && l>=t) {
getPercent = l/t;
loadText = Math.round(getPercent100)+"%";
loadBar._width = getPercent
900;
container._visible = 1;
delete _root.onEnterFrame;
}
else {
getPercent = l/t;
loadText = Math.round(getPercent100)+"%";
loadBar._width = getPercent
900;
}
};
SIZE][/COLOR]

the buttons use this code:

[SIZE=1][COLOR=DarkRed]on (release) {
container.loadMovie(“http://www.enorme.org/peterson/pic02.jpg?uniq=”+myIdentifier,1);
}[/COLOR][/SIZE]

Technically it works but there are some pesky little issues that prevent me from jumping up and down and performing my ever popular happy dance:

A.) Apparently, I have to click on the images twice for them to load. This is the main problem.

B.) Problem 2 has to deal with the pesky NAN that appears in the loadText box; I would like to replace that with )% or something. I am working on this now … it seems simple enough.

C.) I am sure there is a solution floating around but I am also trying to get the loadBar to run a little smoother. I am sure shrinking it to a non-gargantuan size may help. Any hints?

I think thats it … for now. Please don’t pass judgement on the ‘design’ or its lack thereof, I want to get the code working before I attemt to make it look cool.

Thanks,
Brian
http://www.enorme.org/peterson/