BeetleDev.com
info
contact
Monday, August 19, 2019
Beetle Blog
1
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) {
 nextScene();
}
bytesLoaded = getBytesLoaded();
totalBytesLoaded = getBytesTotal();
pLoaded = Math.round((bytesLoaded/totalBytesLoaded)*100);
progressBar._xscale = pLoaded;

In the second keyframe enter:
gotoAndPlay(1);

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.

1

Beetle Blog v0.2.2


Copyright © 1997 - 2019 BeetleDev.com. All rights reserved.