I am attempting to make an All Flash website that uses one SWF as the main page, with each subsection dynamically loaded via the loadMovie command. I would like each subsection to have a preloader for itself, but the problem i encounter is that the dynamically loaded SWF’s use _root in the preloader, and therefore do not work when loaded into the main movie.
My question is, how can i change the code so that the preloader works for each SWF that its in, even though those are dynamically loaded?
here’s the code as taken from Kirupa.com’s Preloader with Percentage Tutorial:
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(3);
}
Any help would be appreciated… :crazy: