Preload multiple swf's problem!

I have a movie with three buttons that load 3 external swf’s, with a preloader. Now I want all the external swf’s to have a preloader as well. So I used the preloader script on the 3 external swf’s, but when I test it, the movie starts at the first frame, where the preloader of the first swf is supposed to start, but nothing happens. Anyone have a clue, or maybe know a tutorial on this?

regards

What code did you use for the preloaders on the external swfs ?

Thanks for your reply.

something went wrong there!

On the first frame:

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) {
_root.gotoAndStop(3);
}

Sorry, my reply was too long I guess…

second frame: gotoAndPlay(1);
third frame: stop();

I see. The problem is you used _root instead of this. When a movie is loaded into another they share _root, which is why your preloader doesn’t work. Replace your code with this:

[AS]
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent100;
this.loadText = Math.round(getPercent
100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndStop(3);
}
[/AS]

O.K., I solved it, thank you! I had to to change the script in the external swf as well, which I now find logical. Now I have to try to understand WHY this is logical. I still have problems with this _root phenomenon, any tutorial suggestions?
Thanks again

groeten!

  • if you’re interested in art check www.inflicted.nl