# Preloader and sound problem

**URL:** https://forum.kirupa.com/t/preloader-and-sound-problem/35129
**Category:** Uncategorized
**Created:** [November 10, 2003, 9:46pm UTC](https://forum.kirupa.com/t/preloader-and-sound-problem/35129 "2003-11-10T21:46:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![colag](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@colag](https://forum.kirupa.com/u/colag)
#### Post date: [November 10, 2003, 9:46pm UTC](https://forum.kirupa.com/t/preloader-and-sound-problem/35129/1 "2003-11-10T21:46:53Z")

</div>

i have a .swf movie which is about 350k and all but 25k is an embedded mp3. but my preloader doesn’t work properly in the sense that it only appears once the the mp3 has downloaded. at the moment the preloader reads:

onClipEvent (enterFrame) {  
loading = \_parent.getBytesLoaded();  
total = \_parent.getBytesTotal();  
percent -= (percent-((loading/total)_100))_.25;  
per = int(percent);  
percentage = per+"%";  
loadBar.\_width = per;  
if (percent\>99) {  
\_parent.gotoAndStop(2);  
}  
}

the mp3 is in a in a variable ‘tune’ which is in a clip called ‘sound’ and that clip is in a clip called ‘music’. music is found on the root level.  
tune = new Sound();  
tune.attachSound(“myMP3”);  
tune.start(0,999);

any help will be gratefully received.  
thanx

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 10, 2003, 10:09pm UTC](https://forum.kirupa.com/t/preloader-and-sound-problem/35129/2 "2003-11-10T22:09:33Z")

</div>

could you ad a fla file?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 10, 2003, 10:54pm UTC](https://forum.kirupa.com/t/preloader-and-sound-problem/35129/3 "2003-11-10T22:54:28Z")

</div>

hi,  
you can see my .fla the following url:  
[http://www.audiogroove.co.uk/audio1.0.fla](http://www.audiogroove.co.uk/audio1.0.fla)  
thanx,  
colin

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 11, 2003, 10:27am UTC](https://forum.kirupa.com/t/preloader-and-sound-problem/35129/4 "2003-11-11T10:27:28Z")

</div>

The problem is probably your MP3 in the library being exported in first frame. A better solution, definately since it’s only 25k, is loading your sound externally instead of placing it in the library. Very simple, just delete the mp3 from your library, place the mp3 file in the same folder as which your swf is in (or will be in), and replace the attachSound line by

```auto
tune.loadSound("myMP3.mp3",true)

```

Where true indicates streaming or not.
