PDA

View Full Version : Advanced Preloader


asgsoft
02-05-2005, 01:11 PM
Here is a great preloader. i am currently working with it to make a bar that increases sizwe. so watch out for it soon
// Specify how many frames to load before playing.
var loadAmount = _totalframes;
// If the required number of frames have finished loading...
if (_framesloaded == loadAmount) {
// ...start the movie
gotoAndPlay ("beginMovie");
} else {
// ...otherwise, display the load status
// then go back and check load progress again.
// First, determine the loaded and total kilobytes.
loaded = Math.round(getBytesLoaded()/1024);
total = Math.round(getBytesTotal()/1024);
percent = Math.round((loaded/total)*100);
// Display the loaded kb, total kb, and percentage of
// kb loaded in text fields.
bytesLoadedOutput = loaded;
bytesTotalOutput = total;
percentOutput = percent+"%";
// Set the width of the loadBar to a percentage of
// the loadBarHousing.
loadBar._width = loadBarHousing._width*(percent/100);
// Now go back and check load progress.
gotoAndPlay ("loading");
}

Dragon Gamer
03-08-2005, 06:44 PM
You know it would be great if you could show an example of this code being used.

So we know if it is right for us to use it for our sites.