# Load movie & its preloader acts odd

**URL:** <https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650>\
**Category:** Uncategorized\
**Created:** [September 18, 2002, 5:11pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650 "2002-09-18T17:11:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcs](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jcs](https://forum.kirupa.com/u/jcs)\
**Post date:** [September 18, 2002, 5:11pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650/1 "2002-09-18T17:11:25Z")

</div>

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](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](http://www.chile2002.org/curriculum/geopolitical.html)  
(click “see interactive feature”)

Thanks much,  
JC

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2002, 5:35pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650/2 "2002-09-18T17:35:07Z")

</div>

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 [olives@funkyolive.com](mailto:olives@funkyolive.com) 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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2002, 6:15pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650/3 "2002-09-18T18:15:20Z")

</div>

Test it at:

[http://flex.funkyolive.com/test/container3.swf](http://flex.funkyolive.com/test/container3.swf)

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2002, 6:34pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650/4 "2002-09-18T18:34:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2002, 7:14pm UTC](https://forum.kirupa.com/t/load-movie-its-preloader-acts-odd/5650/5 "2002-09-18T19:14:39Z")

</div>

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:)
