Now: Tutorial for Web and Software Design > Flash > Action Script > Flash Content
> Preloading Main Movie With Levels all Together [Bookmark it]
Preloading Main Movie With Levels all Together

Preloading main movie with levels all togetherI 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.

1:

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.

2:

Here is the code to preload the movie(s) Put this code on your preloader:

onClipEvent
// Load Three movies loadMovieNum ("Music.swf", 1);
(load) {
   loadMovieNum ("Music.swf", 2); loadMovieNum ("Music.swf", 3);
}
// We devide it by 1000 to get rid of the
onClipEvent (enterFrame) {
   decimal numbers Total =
Math.floor(_level1.getBytesTotal()/1000) + (_level2.getBytesTotal()/1000) + (_level3.getBytesTotal()/1000) + (_root.getBytesTotal()/1000);
   Loaded =
Math.floor(_level1.getBytesLoaded()/1000) + (_level2.getBytesLoaded()/1000) + (_level3.getBytesLoaded()/1000) + (_root.getBytesLoaded()/1000);
Percent = Math.floor((Loaded/Total)*100);
_root.PercentDisplayTwo = int(Loaded)+" KB "+" | "+(Total)+" KB"+" | "+(Percent)+" %";
// Have a frame lable inside the loaded movie so you can park it
// and call it when ever you want

if (Percent == 100) {
   _level1.gotoAndStop("One"); _level2.gotoAndStop("One");
   _level3.gotoAndStop("One"); _root.play(); }
}

[Bookmark][Print] [Close][To Top]
  • Prev Article-Flash:

  • Next Article-Flash:
  • Related Materias
    Spinning Wheels
    Creating the Illusion of S
    Create Flying Hearts Effec
    Typewriter Effect
    Creating Sound Control
    Movie and Image Preloader 
    Flash Preloader
    Principles of Animation - 
    Principles of Animation - 
    Transparent Objects
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial