SWF with preloader won't load! WHY?!?

I can’t load external movies.

I have my index.swf and i have a space to load an external swf called “photos.swf”. I have created, inside index.swf, an empty Movieclip and I’ve named it “load_movie_photos”. In a frame in the main timeline of the index.swf I used the code:

loadMovie(“photos.swf”, “load_movie_photos”);

In the “photos.swf” I have a scene with a preloader and a scene with the content, called “photos_content”. In the preloader I have this code:

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent100;
_root.loadText = Math.round(getPercent
100)+"%";
if (bytes_loaded == bytes_total) {
gotoAndStop(“photos_content”, 1);
}

When I test my index.swf it doesn’t load the external photos.swf

But if I erase the scene with the preloader from the photos.swf it loads it in index.swf without problems.

What’s happening?

:expressionless:

It is because you are using _root in your external swf. _root always refers to the main timeline of a project. Once you load an external swf into a main file then _root becomes the timeline of the main file. So Flash can’t find your preloader stuff because it is no longer on the _root timeline, it is now at _root.load_movie_photos

External swfs are very useful but a bit tricky. You have to get the pathways correct in your external swf to reflect their location once they’re loaded into a main file. This means that they won’t work on there own, only when loaded in. Also, any change you make in the external swf means you have to republish the external swf and then test the main movie to see the change.

Worth it overall though.

Hope this helps!
:hr:

Hi!

Thanks, Lunatic! My problem was solved!

worldsound

lol, my pleasure worldsound - glad you got it worked out. :thumb: