Hey there, I’m working on a site and we have a bunch of pages that load a .swf and inside that .swf is an mp3 that plays when it is done loading. I currently have a preloader but a lot of the songs take quite some time to download and I would like the song to stream. Does anybody have any ideas how I can accomplish this? Here is the code I’m using in the preloader scene, I believe I grabbed it from one of Kirupa’s tutorials:
// 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(“Preloader”, “begin”);
} 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”);
}
Thanks again!
Duke