# How To Stream Music?

**URL:** <https://forum.kirupa.com/t/how-to-stream-music/240752>\
**Category:** flash\
**Created:** [October 5, 2007, 6:49pm UTC](https://forum.kirupa.com/t/how-to-stream-music/240752 "2007-10-05T18:49:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigDukeyDog](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@BigDukeyDog](https://forum.kirupa.com/u/BigDukeyDog)\
**Post date:** [October 5, 2007, 6:49pm UTC](https://forum.kirupa.com/t/how-to-stream-music/240752/1 "2007-10-05T18:49:02Z")

</div>

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
