Load movie & its preloader acts odd

Hey all:
I have two swf’s: a “container” movie with a button that loads another swf into an empty movie clip. The loaded movie is large, so I added a preloader Kirupa developed that has been working very well for me. Everything works and tests fine offline. However, when I hardcode the HTTP path into container’s AS for the loadMovie and post online, the preloader for the loaded movie stops working properly.

Here is the AS for that preloader:

onClipEvent (enterFrame) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if (bytes_loaded == bytes) {
_root.gotoAndPlay(2);
this.loadtxt = “movie loaded”;
} else {
_root.gotoAndStop(1);
this.loadtxt = “loading map(” + bytes_loaded + “/” + bytes +")";

}
}

Instead of displaying load progress (“loading map (xxx/xxx)”), the preloader displays “movie loaded” until the movie has loaded. I suspect the problem might also lie with the code in the container movie. Here’s the script to call the movie (action is on a frame, not the button):

map.onPress = function() {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“http://www.chile2002.org/curriculum/interactive/geopolitical/mag.swf”, “container”);
container._x = 200;
container._y = 0;
};

The FLAs were too big to attach, but you can see the movie (& problem) here:
http://www.chile2002.org/curriculum/geopolitical.html
(click “see interactive feature”)

Thanks much,
JC

I haven’t seen Kirupa tutorial, but when you use:

_root.getBytesLoaded();

depending on where you’re calling it from, should you use the path of the movie that’s being loaded?

Post a link to your fla. or email it to me at [email protected] and I’ll have a look at it, - unless someone else knows what the problem is, because these kind of probs seem to be common…

Test it at:

http://flex.funkyolive.com/test/container3.swf

If that’s ok I’ll email you the modified fla’s.

I’ve taken them off now… Check your email.

Flex,
worked great; I’d not realized I was calling for the bytes from teh container and not the loading movie.

dot syntax to the rescue!

JC:)