Start flash site

Hello evry body!!
I want to know how I can make a flash web site with starting progress bar .
I be very happy that you answer this question!!
Tanks about evry things…

are you talking about a preloader which tells how much of the swf has loaded?

Another great subject for a tutorial, don’t you think ?

pom

Isn’t it? Gotta admit those loaders are much cooler.

Kirupa are you here ?
Request permission to try to make a preloader tutorial to end those endless questions about them.

pom

Still I should explain a little bit. Quite simple really.

Name your layer background. In the first frame, draw a bar and write something like “loading”, “wait please” or anything you like, be creative, that’s what Flash is all about.
Create a new layer and name it “bar”. In this layer, draw a bar that has the same size as your previous bar, but with a different colour. Otherwise you won’t see it.
Select this bar. Press F8 to convert it into a MC you’ll name it “bar”.
Edit the bar and move it so that the little crosshair is at the top left of the bar. Go back to the scene and readjust the position of your bar. Still here ?
Go to frame 2 and add a keyframe in your background layer, but change the text by “Done”, or “Complete” or anything you like.
Go back to the previous frame (1). Select the bar. Go to the transform panel and uncheck “constrain”. Put the vertical scale at 0.1 %. You should now see only a little tiny bit of bar. That’s normal.

Now we have to put the code. Add a new layer and name it code. In frame 1, open the frame action panel and type : stop () ;
Now click on you tiny bar, and open the object action panel and hang on :

onClipEvent (load) {
tkb = _root.getBytesTotal();
}

When the clip loads (therefore we do this only one time), we get the total bytes of your .swf.
Now under this :

onClipEvent (enterFrame) {
scale = ((_root.getBytesLoaded()/tkb)*100);
this._xscale = scale;
if (scale == 100) {
&nbsp &nbsp &nbsp &nbsp _root.nextFrame();
}
}

On each frame, the variable scale is set to the percentage of bytes loaded with the eponym function.
this._xscale = scale; is tricky : this. means it concerns the current object, hence the bar. _xscale is the lenght of your bar. You set it to the percentage of bytes loaded (normal).
The if loop check if everything’s loaded. If it’s not, the clip loops, if it is, we go to the next frame with “Complete” on it.

Should work perfectly. Of course, you won’t see it when you test your movie. To see it in action, you have to put some heavy stuff somewhere in your animation, put it online, and try to see how it works. Post if you want the .fla

Enjoy !!!
pom

sounds good…