this uses the getBytesLoaded and getBytesTotal methods to find out how much of the movie is loaded. Or you can try (my prefered preloader method) of creating a separate movie that loads your actual content into a new level and preloads that. You can download an fla file for this technique from http://www.angelfire.com/electronic2...intolevel.html
you need 2 files, the movie you want to preload, which has all your sites content in should have a stop(); action on frame 1. The other movie which acts as the preloader should be scripted like this,
frame 1.
loadMovieNum("yourmainmovie.swf", 1); // load the movie into level 1
frame 2
if (_level1.getBytesTotal() > 0) { // movie is loading
loaded = _level1.getBytesLoaded();
total = _level1.getBytesTotal();
percent = Math.round((loaded / total) * 100);
loadbar.gotoAndStop(percent);
if (loaded == total) {
_level1.play(); // start the main movie
gotoAndStop(4); // and end this preloader
}
}
frame 3
gotoAndPlay(2); // loop back
where loadbar is a movieclip 100 frames long that shows your loading bar animation. and frame 4 is a blank keyframe to hide the preloader once the movie has been loaded.
Okay, I have a file called "picture1.fla", and the preloader called "loadintolevel.fla".
I have attached the loadintolevel.fla, but I can't attach picture1.fla, cause it is too big.
I have 6 layers. In the first layer, I have all the pictures in my slideshow. In the second and third layer, I have the 2 pictures that drop down.
Layer 4 is the music layer, layer 5 is the actions layer, and layer 6 is the next part of the movie, after the person clicks on a link.
I tried putting stop(); in the actions menu on just layer 1.
Then I tried putting it in all the layers.
I save everything.
I close out of everything.
And I go into my flash folder and double click on "loadintolevel.swf", it opens up the preloader bar, I am able to see that for a few seconds(during that time, nothing changes, the bar doesn't move, there are no numbers, nothing changes on the screen at all). Then it goes to the movie "picture1.swf", it starts playing that (at an alright speed, [not as fast as it should be]), then when it gets to the part in the movie where the two pictures drop down, it pauses for a few seconds, then it continues.
1. what i said, change frame 3: gotoAndPlay(2);
2. frame 2: change "loadbar" to "percentbar" (u dun even know what u name ur own symbol? )
3. you should extend your non-action layers to frame 4 also, else when movie is loaded u won't see anything. get what i mean? frame 4 should not be empty of symbols!
here's the file i have, it works. if u test it, u wont see the preloader load at all becos it's too fast. if u include my step 3, then u will see that the preloader really do works. the streaming test in flash will not work cos it will only stream the main swf and not any loaded movies/sounds, so the only way to really test it out is to put it on the net.