# mp3 preloader code check please

**URL:** <https://forum.kirupa.com/t/mp3-preloader-code-check-please/37900>\
**Category:** flash\
**Created:** [December 15, 2003, 8:48pm UTC](https://forum.kirupa.com/t/mp3-preloader-code-check-please/37900 "2003-12-15T20:48:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crapboyjr](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@crapboyjr](https://forum.kirupa.com/u/crapboyjr)\
**Post date:** [December 15, 2003, 8:48pm UTC](https://forum.kirupa.com/t/mp3-preloader-code-check-please/37900/1 "2003-12-15T20:48:26Z")

</div>

I’m trying to preload a dynamic mp3 and show the percentage loaded as a number and a graphic bar. But it’s not working.

The following code is on the the movie clip that the mp3 is being loaded into.

* * *

onClipEvent (load) {  
mySound = new Sound();  
mySound.loadSound(“music.mp3”, false);  
}

onClipEvent (enterFrame) {  
downloaded = mySound.getBytesLoaded();  
total = mySound.getBytesTotal();  
percent -= (percent-((downloaded/total)_100))_.25;  
per = int(percent);  
percentage = per+"%";  
loadBar.\_width = per;

if (percent\>99) {  
\_root.gotoAndPlay(“intro”);  
}  
}

* * *

Thanks.
