Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loader bar

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
greetings,
im sorry to fill this nice forum with stupid questions :-/

however i just wanted to ask how to create those "loading" bars you see everywhere shown while movies and menues load?

a link to some nice tutorials would help a lot too so i dont have to ask that much.

thx for any replies
WhiteChild
 
You need to find out two things about your movie to make a preloader.

1) How big your movie is.
2) How much has loaded so far.

You find out 1) by using getBytesTotal(); and 2) by using getBytesLoaded();

If your movie is loaded then logically 2) has to be equal to 1) so your actionscript would be...

if(getBytesLoaded>=getBytesTotal){
//play movie
}

if 2) is less than 1) then display the percentage...

percentage=(getBytesLoaded/getBytesTotal)*100;

you can display this value by putting a dynamic textbox on the stage and giving it the variable name "percentage" (in the "text options" tab)

now place a stop(); action in frame 1 of your movie...

the rest of the code can live in a movieClip - make a clip out of any shape you like, drag it off the stage because we don't need to see it, click it and add these actions to the panel...

onClipEvent (enterFrame) {
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
if (loaded>=total) {
_root.gotoAndPlay(2);
} else {
_root.percentage = (loaded/total)*100;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top