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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preloader in Flash !!!!!!!!

Status
Not open for further replies.

Demis

Programmer
Jan 10, 2002
8
0
0
IN
Well Friends,

I made a preloader in flash..But dont know how to implement it before the main movie loads..Can anyone help me.. Hope this is simple

Thanks in Advance
DEMIS...........................................
 
go to the FAQ section, that is where i learned it, has good tutorials on the subject.
 
Hi.

Basically, you leave the first 2 frames of your movie empty.

In the first frame, put text that says "loading...please wait." also put a script tht says if_frame_loaded (N) goto 3 and play.

N is the max number of frames in your movie.

In the second frame, put the same text, "loading , please wait" and also put a script that says goto 1 and play.

and thats it.
 
frames loaded gives a skewed reading since you may have 500k in the first one and 20k in the next. You need to use the _getBytesLoaded property divided by the _getBytesTotal property as in the following example:

This action would go on frame 1

Total = getBytesTotal();
Loaded = getBytesLoaded();
Percent = int((Loaded/Total)*100)+"%";
if (Total==Loaded) {
gotoAndStop ("Main", 1);
} else {
play ();
}

this action would go on frame 3

gotoAndPlay (1);


You then create a dynamic text box in a separate layer spread from frame 1 to frame 3 and name it Percent.

works like a charm! Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top