Ok, step 1
- go to the scene palet and creat a new scene. Name it "preload"
- on the first frame, layer 1 of this scene, you will want to place whatever graphics and/or text you wish people to see while your movie loads up. For the sake of this tutorial just type the words "movie loading" and center it on the stage. Extend this text for three frames (place cursor on frame three and press F5).
- now create a second layer. Name this layer "actions" and create an empty keyframe on frame two (you can create an empty keyframe by clicking in frame two and pressing F7)
- open the actions palet and place the following code
- "var total" is a variable you have created which holds the total number of bytes in the movie
- "var loaded" hold the total numbery of bytes which have loaded thus far.
- the "if" statement looks to see if the number of loaded bytes equals the total number of bytes in the movie. If they are equal then the timeline is told to go to and play the first frame of the next scene. In this example my next scene is called "intro" (change "intro" to reflect the name of your next scene).
var total = _root.getBytesTotal();
var loaded =_root.getBytesLoaded();
if (loaded>=total) {
gotoAndPlay("intro", 1);
} - now create another blank keyframe in frame three of the "actions"
layer. Place the following code in the actions palet.
gotoAndPlay(1); - if the script in frame two determines that the movie has not been loaded yet, the timeline will continue on to frame three. Here we want to send the timeline back to the beginning so it will loop over and over until the movie has loaded.
Step 2
- create a new layer and name it "bar". In frame one create a long bar on the stage using the rectangle tool. Extend this image accross all three frames (F5).
- now, select the bar and press (F8) to turn the bar into a symbol. Choose movie clip and name it "loadbar". Now name the movie clip instance "loadbar" (without quotes) in the properties inspector.
double click "loadbar" so that you are working on the "loadbar" timeline. On frame one choose the setProperty action.You will see three entry options Property, Target and Value.
Property: from the drop down choose _xscale (X scale factor)
Target: type in "this" without quotes. and check
the expression box to the right.
Value: type in the following code (_root.getBytesLoaded()/(_root.getBytesTotal()))*100
then check the expression box to the right.


