# Dynamically loaded mp3...I wish

**URL:** https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750
**Category:** Uncategorized
**Created:** [December 13, 2003, 12:05am UTC](https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750 "2003-12-13T00:05:45Z")
**Posts on this page:** 4
**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 13, 2003, 12:05am UTC](https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750/1 "2003-12-13T00:05:45Z")

</div>

Hey Everyone,

I’ve searched the forums and tutorials and I’m using the code below to load an mp3 dynamically into an empty movie clip.

I want the mp3 loop play once the movie has been loaded.

Tell me if I messed up the code below:

* * *

this.onEnterFrame = function () {  
\_root.createEmptyMovieClip(“container”, 1);  
mySound = new Sound();  
mySound.loadSound(“introloop.mp3”,false);  
}

* * *

Note: when I had the streaming set to “true”, the mp3 sounded crappy. So I changed it to false and there was no sound at all.

Thanks for any suggestions.

---

<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: [December 13, 2003, 12:24am UTC](https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750/2 "2003-12-13T00:24:57Z")

</div>

I’m going to guess that you have a mySound.start() sitting on a movieClip or a different layer or else it won’t start. The reason that when you set streaming to ‘false’, Flash will load the entire sound before playing it. There should be no difference in quality when externally loading the mp3 unless there is a problem with your mp3. Check this out:

```auto

mySound=new Sound();
mySound.loadSound("introloop.mp3",true);
mySound.onSoundComplete = loopSound;
loopSound = function () {
mySound.loadSound("introloop.mp3", true);
mySound.start();
};

```

There is a pause inbetween each play, if you want around that, you need to load the mp3 into your library, and loop it internally.

---

<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: [December 13, 2003, 1:14am UTC](https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750/3 "2003-12-13T01:14:18Z")

</div>

The mp3 is fine.

I may have the code in the wrong place. For example, imagine, you opened a new Flash Document and the code is placed in the 2nd frame. That’s where I put it.

---

<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: [December 13, 2003, 4:57am UTC](https://forum.kirupa.com/t/dynamically-loaded-mp3-i-wish/96750/4 "2003-12-13T04:57:48Z")

</div>

How many frames does your fla contain?
