Preloading main movie with levels all together by Warrior
Bubbly Preloader
by Warrior
 
Create a new movie and have seven layers like the picture below. The outline layer is for the preloader bar.
 
 
Put a stop action in the ActionScript layer. Draw the preloader and give it the name, loading bar in the layer. Create a new movie clip and give it the name all solid bubbles and for the instance name “asb”
 
 
Go inside the new movie clip and create another movie clip and give it the name 'bubbles'.
 
 
Go inside the bubbles movie clip and create three layers all 30 frames.

•  Action Script
•  Guide Layer
•  Bubble

 
 
In the ActionScript layer put this code;
 
  1. // It plays a random part of the movie clip
  2. gotoAndPlay(random(30));
  3. //The higher the numbers the bigger the bubbles.
  4. scale = random(31) + 70;
  5. _xscale = scale;
  6. _yscale = scale;
 
 
Now create a bubble and put it in the bubble layer and have a circle line and put it in the guide layer so that it will guide the bubble to turn in clockwise motion so it looks like it's circling. Like this picture;
 

That's the circle line that will guide the bubble to turn this way like a clock hand.
 
Now go back to the all solid bubbles movie clip and copy and paste the bubble you just created so it looks like the third picture in this tutorial.
 
Create a new movie clip and give it the name all Hallow Bubbles, which is also the name of the instance, name. Go inside the Hallow Bubbles and draw a circle so it looks like an Olympic circle like this;
 
 
Now turn that circle into a Movie Clip and give it the name “Plain Bubbles”. Now go inside the movie clip plain bubbles you just created and turn the circle into a graphic so you can add a fade effect. Now create two layers like the picture below and notice that we are editing the in the plain bubbles and it's also 30 frames long.

•  Action Script
•  Plain Bubbles

 
 
  1. // Go to and Play and random frame
  2. gotoAndPlay(random(30));
  3. // Scale it randomly to size 101.
  4. // The bigger the number the bigger the Bubbles
  5. scale = random(101);
  6. _xscale = scale;
  7. _yscale = scale;
 
Animate the Bubbles so they go from left to right and fade out. Go back one movie clip to All Hallow Bubbles and copy and paste the plain bubbles (don't copy and paste too many) and position them like the picture above. Go back to the main movie and position the full bubbles on the left hand side of the preloader and the plain bubbles a bit to the right like the picture below;
 
 
Create your preloader bar and put it at the bottom. Create a new layer and name it “Mask”. Copy and paste the preloader bar graphic, not the movie clip, and place it in the Mask layer so that it covers the whole preloader bar. What the Mask does is it stops the bubbles from going out of the outline area, which make it look unprofessional and dodgy. Create a dynamic textbox and give it the variable name “PercentDisplay” and place it anywhere on the stage. Copy and paste this code on the preloader if you created your own style of preloader and didn't use the one with this tutorial. If you used the preloader that came with this tutorial then you don't need the code as it's already there.
 
 
  1. onClipEvent (load) {
  2. Total = Math.floor(_root.getBytesTotal() / 1000);
  3. // The Loading messages for the preloader
  4. loadMessage = new Array("Angel of God", "My guardian dear", "To who God's Love",
  5. "Commits me here", "Ever this day", "Be at my side",
  6. "To light and guard", "To rule and guide", "Amen");
  7. currMessage = 0;
  8. }
  9.  
  10. onClipEvent (enterFrame) {
  11. Loaded = Math.floor(_root.getBytesLoaded() / 1000);
  12. Percent = Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100);
  13. // Devide the length of the message by 100
  14. division = 100 / loadMessage.length;
  15. // Current message X division
  16. limitInf = currMessage * division;
  17. // Go through the messages one at a time according to the length
  18. limitSup = (currMessage + 1) * division;
  19. // Text Display
  20. _root.PercentDisplay = int(Loaded) + " KB Out Of" + " | " + (Total) + " KB" + " | " + (Percent) + " % | " + loadMessage[currMessage];
  21. // If the preloader is greater then current text in the message
  22. if (Percent > limitSup) {
  23. // move on to the next text in the Array
  24. currMessage++;
  25. }
  26. // Keep the length of the message equal to the preloader
  27. gotoAndPlay(Percent);
  28. // Set the width property of the Bar
  29. setProperty(_root.Preloader, _xscale, Percent);
  30. // Set the X position of the filled bubbles with the Bar
  31. _root.asb._x = _root.Preloader._width + _root.Preloader._x;
  32. // Set the X position of the Empty bubbles with the Bar
  33. _root.ahb._x = _root.Preloader._width + _root.Preloader._x;
  34. // If the Movie has loaded, play
  35. if (Percent == 100) {
  36. _root.play();
  37. }
  38. }
 
Here is the working version that you can see.
 

FlashVacuum Flash ActionScript Tutorial CyanBlue subQuark JT

You do not have the Flash plugin installed, or your browser does not support Javascript.

 
This tutorial belongs to Warrior who is a member of Flash Vacuum. If you have any questions or comments regarding this tutorial, please post them in the forum at ActionScript 1.0 :: F5 & FMX section as I will not be answering any e-mails or PM's that require help.
 

 

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