Quote:
Originally Posted by Warrior
I don't want to load all the website in one go because I only load what you want to see when you want to see it. To park movies you have to put a stop(); action in the first Keyframe of the movie being loaded and nothing else. No movie clip, no graphic, no music or picture but just an empty Keyframe and a stop(); action. Then you load the movies you want. You can load all the movies at once or just a few. Here is the code
ActionScript Code:
// Put this code 5 frames before the preloader
loadMovieNum ("1.swf", 1);
loadMovieNum ("2.swf", 2);
loadMovieNum ("3.swf", 3);
ActionScript Code:
// Put a stop(); action on the Keyframe of the preloader
// This preloader must be on a movie clip.
onClipEvent (enterFrame) {
Total = (_level1.getBytesTotal()+_level2.getBytesTotal())+_level3.getBytesTotal() + _root.getBytesTotal();
Loaded = (_level1.getBytesLoaded()+_level2.getBytesLoaded())+_level3.getBytesLoaded() + _root.getBytesLoaded();
percent = Math.floor((Total/Loaded)*100);
display = percent+"% Loaded";
if (percent == 100) {
_root.gotoAndStop("Frame Lable");
}
}
|
This thread is awesome and I think that Warrior's code is going to help me do what I need to get done, but I need a little more hand holding than you guys have already provided.
Before I try using this code and screw everything up, I was hoping someone could let me know if I'm getting this right.
I have a file: leftNav.swf. This file calls in 2 external movies: flame.swf and smallflames.swf. I want the 2 external files to preload and I don't want the user to see anything other than a loading bar before the files are completely loaded. It looks like this code will take care of my issue, but I want to make sure I've got the steps down:
- Open the external movie(s).
- Add a blank keyframe to frame 1 of the external movie(s).
- Add a stop(); action to this new blank keyframe. There should be nothing else in this frame. The movie content should start on frame 2.
- Open the movie that calls the external movie(s).
- Add 6 frames to the beginning of this movie.
- In frame 1 add the first chunk of code but change 1.swf, 2.swf & 3.swf to the names of the external files you're preloading. (In my case, this would be flame.swf and smallflames.swf and I wouldn't need the 3rd one)
- In frame 6 add a stop(); action.
- In frame 6 add a blank movie clip.
- Add the second chunk of code to the blank movie clip in frame 6.
- Add a frame label to frame 7.
- Modify the second chunk of code to gotoAndStop or gotoAndPlay (depending on the type of movie you have) whatever you labeled frame 7.
Is this right? Am I missing any steps? If someone will help me confirm this, I'll be happy to post a step-by-step tutorial for others to reference.
Thanks!