I have made a 2 Kb preloader for a 783 Kb page. It is supposed to show a
counter going from 0% to 100% as it loads the main movie into a
container movie clip and then, when it is fully loaded, the main movie
starts.

I've tryed it with the Flash MX 2004 Download simulation and it works
but when I upload the page to the server, it doesn't work the way it was
meant.

Instead of that, The counter doesn´t appear and the movie starts playing
before the loading is fully concluded so it begins playing, stops
waiting for content needed for some frame and then continues.

What is wrong with my code?

The scenery just contains a dynamic text whith the variable "loading"
and an empty movieclip at 0,0 called "container"

-----------First frame is:

loadMovie("home.swf", container);
//loads the big movie in empty movieclip placed at 0,0 coordinates

-----------Second frame:

container.stop(); //keeps the movie from starting until it is fully loaded
total = container.getBytesTotal();
loaded = container.getBytesLoaded();
if ((loaded >= total) && total > 0) {
//checks if movie is completely loaded and also if there is
//something already loading in the container
gotoAndStop(4); // exits the loading loop
}
loading = "LOADING... "+Math.round((loaded/total)*100)+"%";
// this variable is the text for the textfield in the counter

-----------Third frame:

gotoAndPlay(2);

-----------Fourth frame:

stop();
container.play();

As simple as this, but it works in the simulation but not in the www.

Any help would be greatly appreciated.

JW