Thursday, October 29, 2020
Beetle Blog
By: douglas - Flash - 6/15/2002 12:00:00 AM

This technote applies to Flash MX and details a method that may be used to create a preloading progress bar before your main flash movie begins playing.

Create a new scene, making it the first scene in the movie.

Rename the first layer to "actions"

Create two empty keyframes in the first and second frames of the "actions" layer.

In the first keyframe, enter:
if (_framesloaded>=_totalframes) {
bytesLoaded = getBytesLoaded();
totalBytesLoaded = getBytesTotal();
pLoaded = Math.round((bytesLoaded/totalBytesLoaded)*100);
progressBar._xscale = pLoaded;

In the second keyframe enter:

Insert a new layer.

Rename the layer "progress bar".

In the first frame of the "progress bar" layer, draw a rectangle, making it the length that you want your progress bar to be.

Convert the rectangle into a movie clip, making sure that its registration point is to the left.

Name the movie clip instance "progressBar".

Save your movie.

Go to "Control" then "Test Movie".

Set the desired download speed under "Debug".

Choose "View" then "Show Streaming".

Your progress bar should now be progressing as your movie loads.


Beetle Blog v0.2.2

Copyright © 1997 - 2020 All rights reserved.