Preloading main movie with levels all together by Warrior
Preloading main movie with levels all together
by Warrior
 
I have struggled so hard to find a cure for this. After trial and errors, thank God, I found a way to preload the main movie with levels all at the same. Some websites preload levels one at a time and it will get annoying for some users to wait every time for a different movie to load. If you follow this tutorial carefully, you should have no problem.
 
Put a stop(); action in the first Keyframe of the movie(s) 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 to preload the movie(s) Put this code on your preloader.
 
  1. onClipEvent (load) {
  2. // Load Three movies
  3. loadMovieNum ("Music.swf", 1);
  4. loadMovieNum ("Music.swf", 2);
  5. loadMovieNum ("Music.swf", 3);
  6. }
  7.  
  8. onClipEvent (enterFrame) {
  9. // We devide it by 1000 to get rid of the decimal numbers
  10. Total = Math.floor(_level1.getBytesTotal() / 1000) + (_level2.getBytesTotal() / 1000) + (_level3.getBytesTotal() / 1000) + (_root.getBytesTotal() / 1000);
  11. Loaded = Math.floor(_level1.getBytesLoaded() / 1000) + (_level2.getBytesLoaded() / 1000) + (_level3.getBytesLoaded() / 1000) + (_root.getBytesLoaded() / 1000);
  12. Percent = Math.floor((Loaded / Total) * 100);
  13. _root.PercentDisplayTwo = int(Loaded) + " KB " + " | " + (Total) + " KB" + " | " + (Percent) + " %";
  14. if (Percent == 100) {
  15. // Have a frame lable inside the loaded movie so you can park it
  16. // and call it when ever you want
  17. _level1.gotoAndStop("One");
  18. _level2.gotoAndStop("One");
  19. _level3.gotoAndStop("One");
  20. _root.play();
  21. }
  22. }
 

 

   |      |      |   Last Modified: July 17, 2009 @ 4:25 am