# Dynamic loaded mp3's don't always start

**URL:** <https://forum.kirupa.com/t/dynamic-loaded-mp3s-dont-always-start/154817>\
**Category:** Uncategorized\
**Created:** [July 12, 2005, 11:36pm UTC](https://forum.kirupa.com/t/dynamic-loaded-mp3s-dont-always-start/154817 "2005-07-12T23:36:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jake74](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jake74](https://forum.kirupa.com/u/jake74)\
**Post date:** [July 12, 2005, 11:36pm UTC](https://forum.kirupa.com/t/dynamic-loaded-mp3s-dont-always-start/154817/1 "2005-07-12T23:36:47Z")

</div>

Check it out: [http://forward1.com/nasa/mplane/](http://forward1.com/nasa/mplane/)  
the buttons load movies into this interface. The first two are the culprits(introduction, Why Mars?).

Inside the movies there’s code to load up a bunch of MP3’s. I’m using a pre-loader to get everything loaded before I start any of the sound objects. But sometimes the first MP3 file doesn’t start to play. Also my text variables aren’t always loaded. Here’s the code on my first frame:

```auto
 
stop();
//background sound
bgloop = new Sound();
bgloop.loadSound("2/bgloop.mp3");
//create an array of mp3's to load
mp3s = ['2-1.mp3', '2-2.mp3', '2-3.mp3', '2-4.mp3', '2-5.mp3', '2-6.mp3', '2-7.mp3'];
//create a sound object for each movie clip
for (i=0; i<mp3s.length; i++) {
 _root["narr"+i] = new Sound();
 _root["narr"+i].loadSound("2/"+mp3s*);
}
//load up the external text file
theText = new LoadVars();
theText.load("text/2.txt");

function loader() {
 bytes_loaded = Math.round(getBytesLoaded());
 bytes_total = Math.round(getBytesTotal());
 getPercent = bytes_loaded/bytes_total;
 loadText = Math.round(getPercent*100)+"%";
 
 if (bytes_loaded == bytes_total) {
  gotoAndPlay(2);
  clearInterval(checkLoadProgress);
 }
}
checkLoadProgress = setInterval(loader, 50);
theText.onLoad = function(success) {
 if (success == true) {
  _root.ccText = theText[segment];
 }
};
function updateText(segment) {
 _root.ccText = theText[segment];
} 

```

On my second frame I have:

```auto
stop();
bgloop.setVolume(30);
bgloop.start(0,99);
_root.narr0.start(0,1);
updateText("one");

```

It seems to work allright for movie 3, but 1 and 2 are playing before everything is loaded (I think). What is this? I’m thinking the preloader isn’t working quite right. Any ideas?
