PDA

View Full Version : Preloader Help!


tecluchi
01-24-2005, 09:12 PM
Hi everybody i'm building a website with a common preloader for each of the externals swf files that will be loaded. Then i have a home, about, gallery, etc buttons. So everytime you press a button it will play a MC called transitions. This transition MC has about 30 frames where the first 10 are a label called "closing" (a transition) and the next frame (11) is where the MC will be in stand by waiting for the external swf to be loaded and immediately after the swf is loaded it will play the next 19 frames that is another label called "opening".
Everything is working fine but what i need is that while the preloader is preloading a swf file, it'll display the percent amount and a status bar. I know that make a preloader is not difficult thing, but in this particular case i can't make it, cause i don't know where to add the script. In the main movie i have a layer that contains a MC called content and it has the following script:

onClipEvent (enterFrame) {
percent = (this.getBytesLoaded()/this.getBytesTotal())*100;
if (!loaded && this._url != _root._url) {
if (this.getBytesLoaded() == this.getBytesTotal()) {
loaded = true;
_root.transition.gotoAndPlay("opening");
}
}
}

I also have inside the MC called transitions on frame 11 the following script:

loadMovie(_root.section, _root.content);
stop();

And i have an actions layer in the main movie that contains this script:

home.onRelease = function() {
if (_root.section != "t1.swf") {
_root.section = "t1.swf";
_root.transition.gotoAndPlay("closing");
}
};
about.onRelease = function() {
if (_root.section != "t2.swf") {
_root.section = "t2.swf";
_root.transition.gotoAndPlay("closing");
}
};
// Etc......

Now, what i need to know is what code and where i should add it to get a percent and a status bar while is preloading an external swf.
I know my explanation is quite messy but i hope you will understand the idea.
Help Please
Thanks!

tecluchi
01-25-2005, 07:26 PM
Here is an example of the interface i'm using. Actually it's based in a tutorial for preload external files. The website i'm trying to build works as the same as this example, i just need to add the percent loaded and a status bar to the preloader.
Any help will be really appreciated.