# Preloading sounds

**URL:** <https://forum.kirupa.com/t/preloading-sounds/152654>\
**Category:** Uncategorized\
**Created:** [June 26, 2005, 3:16pm UTC](https://forum.kirupa.com/t/preloading-sounds/152654 "2005-06-26T15:16:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ineedsleep](https://avatars.discourse-cdn.com/v4/letter/i/e5b9ba/32.png) [@Ineedsleep](https://forum.kirupa.com/u/Ineedsleep)\
**Post date:** [June 26, 2005, 3:16pm UTC](https://forum.kirupa.com/t/preloading-sounds/152654/1 "2005-06-26T15:16:03Z")

</div>

I want the sounds to be loaded on demand and then play the music clip. I have a loading bar that I want to show the progress.  
on (press) {

\_root.loadBar2.\_xscale = \_root.getBytesLoaded()/\_root.getBytesTotal()\*100;  
if (\_root.loadBar2.xscale == 100){  
var spSound = new Sound();  
spSound.attachSound(“cool 1”);  
spSound.start(0, 99);  
}

this is the code Im using can any one just tellme the best way to do this Im pretty new to flash so if I look like an amatuer thats exactly what I am

many many thanks in advance
