Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Interactivity

Categories Smooth bar preloader
Author: Yuri Demidov | Website: http://www.pixelsystem.com |

 
Page 1
1

Following these easy steps you will be able to have a great looking and smooth moving preloader bar in just a few minutes.

Step 1

In your movie, create a new movie object and call it "loadbar".
In the object create two layers. On the first (bottom) layer, create a thin (or wide) rectangular shape forming a load bar. Position it at coordinates x:0 y:0. The height of the bar can be anything you want, but make sure the width reflects multiples of 100 (100px, 200px and so on). 100px should be enough for a nice thin stylish bar. You can have the bar be any width, and you can experiment with that on your own once you complete this turotial and have a clear understanding of the math involved. This bar can be any color you like as it is the place-holder for the moving progress bar which will fill this space as the movie loads. My suggestion is to have a crisp outline of the bar with space inside allocated for the moving progress. You dont have to convert this shape to an object, so lets just call it placeholder in the rest of the tutorial.

Now, on the second layer, create another rectangle so that when you position it on top of the placeholder, it forms your complete progress bar as it should appear when 100% of the movie is loaded. Make sure to convert this shape into a movie. Call it "progressbar". Se the width of progressbar to 0 via it's movie properties.

Now you have a movie which contains just one frame with 2 layers. The bottom layer has the placeholder rectangle and the top layer the progressbar movie.

Step 2

Make sure that the first 2 frames of your main movie are completely empty on all layers. Create 2 new layers and call them "scripts" and "preload". Take the movie object (loadbar) and place it on the very first frame (make it a key frame) of the "preload" layer.

Now create a key frame on the first frame of the "scripts" layer, go to the actions of that first frame and enter the following code:

_root.loading = getBytesLoaded();
_root.total = getBytesTotal();
_root.incremented = 1;


If you made the width of the placeholder shape 100, leave incremented = 1, otherwise change it to reflect the width of your placeholder shape (2 if it is 200, 3 if 300 and so on).

Now create a key frame on the second frame of your movie in the "scripts" layer (this frame should be empty on all layers up till now) and add the following code to its actions:

_root.loadbar.progressbar._width=((Math.round(_root.loading/_root.total*100))*_root.incremented); if (_root.loading<_root.total) gotoAndPlay(_currentframe-1);

Now go the the "preload" layer and add a frame to it so that you have 2 frames taken by the loadbar movie on that layer. Make sure that this layer only has 2 frames and does not continue any further. Make sure that the "scripts" layer has the 3rd frame as a key frame with no code in it (or whatever code you decide to have there, except for the code we just added to the first and second frames). Its a good idea to use this "scripts" layer for whatever code you will end up having in the rest of your movie.

What you should have now in your movie is the following:

First 2 frames are taken by the script code we just added and the loadbar movie on their respective layers. All other layers of the movie (if you have any other layers) are completely empty of any code on the first 2 frames. They may contain objects as you may want something to appear on the loading screen besides the progress bar (like text for example), just make sure that you understand that the first 2 frames will keep on looping until the movie is loaded 100% at which point the movie will continue onto frame 3 and so on. The following frames (starting from frame 3) are wharever you decide to have in your movie.

Now you can play with the colors of the bar and the code if you like. What you have is a smooth progress bar which truly reflect the loading progress of your movie.

There is another way of making a bar like this. The other way is to use masks and it is used to have more complex progress animation. I will post a turorial on it soon.

Have fun and enjoy your new loading progress bar.

1

» Level Intermediate

Added: : 2004-11-03
Rating: 5.32 Votes: 16
Hits: 822
» Author
pixelsystem.com is a progressive design studio based in the U.S.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments