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

Preloader

Status
Not open for further replies.

bpafc

Technical User
Jul 4, 2003
53
GB
Hi, I have used a template to create a site in flash and would like to know how I can intergrate a preloader into the site. The preloader is a maze game how would I go about this my site is at
 
There are several scripts for preloaders out there, but if you integrate one of your own (a maze game?), you'll have to post some code...

Regards,

cubalibre2.gif
 
the basic heart of the preloader is:

if (getBytesTotal() == getBytesLoaded()) {

} else {

}

[conehead]
 
If your preloader is on the main timeline, and not contained in a movie clip, or not based on an onEnterFrame function, then you would need to create a loop so that the preloader does it's job. It would be something along the lines of...

Frame 1:
Code:
if(_root.getBytesLoaded() >= _root.getBytesTotal()){
    // then the movie is loaded...
    // a gotoAndPlay to the first frame 
    // of your movie...
}
No real need of an else here. Though you could insert code for a loaded percentage display, or a loadbar progress, without an else.

Frame 2: (or further)
Code:
gotoAndPlay(1);
// the actual loop until the movie is fully loaded...


Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top