Preloading external .swf problems

I’m trying to preload an external .swf…

In my main movie I have the folowing script:


In the external movie I have this code looping:

myBytesLoaded = _parent.getBytesLoaded();
myBytesTotal = _parent.getBytesTotal()/percentLoad;
if (myBytesLoaded<myBytesTotal) {
percentOutput = int((myBytesLoaded/myBytesTotal)*100)+"%";
setProperty(“loadbar”, _xscale, (myBytesLoaded/myBytesTotal)*100);
} else {;


The preloader works fine when I test the external movie by itself, but when it’s loaded externally it fails.

Please help, this is killing me.

It should work fine…

Perhaps the _parent is throwing it off.

Since you put a preloader on the main timeline, there is no need for _root or _parent.

And can just be play()



I got mine to work.

  1. make sure you are loading movie using the following:

loadMovieNum (“movie.swf”, 1);

  1. the code that sits in the preloader movie clip on frame 1:

myBytesLoaded = _parent.getBytesLoaded();

myBytesTotal = _parent.getBytesTotal()/percentLoad;

if (myBytesLoaded < myBytesTotal) {
percentOutput = int((myBytesLoaded/myBytesTotal)*100)+"%";

setProperty("loadbar", _xscale, (myBytesLoaded/myBytesTotal)*100);


else {;

Hope that helps…

hmmm thanx… glad u sorted it. The thing is, Im loading my external .swf files into a traget movie clip, wheras you are using levels.

My code therefore looks like:

Main movie code:


(simple preloader on external swf)

total = getBytesTotal();
loaded = getBytesLoaded();
if (loaded>=total) {

I initially planned the site the way you are doing it. I haven’t found a way to get the preloader to work using the target method. If you happen to find a solution please let me know.