however, once my movie is uploaded to the web, there is still a blank square where the stage of my .swf will be once it’s loaded, instead of the preloader being there.
the preloader instead, shows up after the entire thing is loaded. is there a way i can make sure that nothing shows except the preloader until all else is loaded?
Load all of your contents into a “container”(blank movie clip) within your preloader and set the visiblity to false until the movie is completely loaded.
You don’t need all that rounding at all. Try this:
stop();
function preLoad () {
var tBytes:Number = _root.getBytesTotal();
var lBytes:Number = _root.getBytesLoaded();
var pBytes:Number = Math.round(lBytes/tBytes *100);
this._width = pBytes;
_root.text = pBytes + "%";
if (tBytes == lBytes) {
_root.gotoAndPlay(3);
}
};
bar.onEnterFrame = function () {
preLoad();
}
To use that you make you bar a MC with the width you want it to be in the end and place it on the stage with a instance name of “bar”, place a text box on the stage with an instance name of “loaderText”.