# External mp3 problem

**URL:** https://forum.kirupa.com/t/external-mp3-problem/24380
**Category:** Uncategorized
**Created:** [June 30, 2003, 4:55am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380 "2003-06-30T04:55:17Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![outro\_lugar](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@outro\_lugar](https://forum.kirupa.com/u/outro_lugar)
#### Post date: [June 30, 2003, 4:55am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/1 "2003-06-30T04:55:17Z")

</div>

I got help for linking the external mp3s as the user click on them. But there are 5 mp3s on the page, all named and called with instant names. When I click on the ifrst one, it starts playing. But when I press another one, the first song does not stop playing, I can keep on clicking and listen to five songs at the same time. What’s the code to have only one song playing at once?

---

<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: [June 30, 2003, 6:14am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/2 "2003-06-30T06:14:32Z")

</div>

IF u could post some code or and example FLA i could take a look and see what code is needed to stop the sounds.

---

<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: [June 30, 2003, 7:00am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/3 "2003-06-30T07:00:30Z")

</div>

Well to stop and immediately start another song you can use stopAllSound(); and immediately after that start playing any other song.

---

<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: [June 30, 2003, 7:03am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/4 "2003-06-30T07:03:06Z")

</div>

There are better ways then stop all sound. Stop all sound will stop every sound in your SWF including buttons sounds or any other sound u have going on. are u loading the MP3’s with streaming sound or in another SWF in to a layer or level?

---

<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: [June 30, 2003, 7:43am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/5 "2003-06-30T07:43:26Z")

</div>

well, sintax is right, but it depends either way how your loading and playing your sound…are you using a sound object or are you placing the sound on the timeline?? very important…

you can specify which sound to stop using the mySound.stop() function…

---

<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: [June 30, 2003, 7:51am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/6 "2003-06-30T07:51:12Z")

</div>

Yeah that’s true, but the chance that there will actually be a sound playing when stopAllSounds(); is called, is very small. And since another sound starts playing immediately, the user won’t even notice 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: [June 30, 2003, 8:14am UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/7 "2003-06-30T08:14:09Z")

</div>

Well are u using the sound object?

---

<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: [June 30, 2003, 2:06pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/8 "2003-06-30T14:06:41Z")

</div>

the code for the button to start playing the songs is

on(release){  
x = new Sound();  
x.loadSound(myName+".mp3",true);  
x.start();  
}

It’s a band’s site where I am supposed be able to listen if I click on them, and download them if I want to. And there is no other sound at all, it’s only the mp3s.

---

<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: [June 30, 2003, 3:17pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/9 "2003-06-30T15:17:01Z")

</div>

> \*Originally posted by outro\_lugar \*  
> \*\*the code for the button to start playing the songs is

on(release){  
x = new Sound();  
x.loadSound(myName+“.mp3”,true);  
x.start();  
}

It’s a band’s site where I am supposed be able to listen if I click on them, and download them if I want to. And there is no other sound at all, it’s only the mp3s. \*\*

whats the problem?

---

<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: [June 30, 2003, 3:20pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/10 "2003-06-30T15:20:54Z")

</div>

I got help for linking the external mp3s as the user click on them. But there are 5 mp3s on the page, all named and called with instant names. When I click on the ifrst one, it starts playing. But when I press another one, the first song does not stop playing, I can keep on clicking and listen to five songs at the same time. What’s the code to have only one song playing at once?

---

<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: [June 30, 2003, 3:33pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/11 "2003-06-30T15:33:57Z")

</div>

[AS]  
x = newSound();  
x.loadSound(“my.mp3”,true)  
if(playing!=true){// if the song isnt playing  
x.start();  
playing = true;//declare the song as playing  
}  
[/AS]

when playing = true the sound will not start

---

<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: [June 30, 2003, 3:43pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/12 "2003-06-30T15:43:12Z")

</div>

I want whatever that was playing to stop and let the new clicked on one to start playing. So I don’t want the sound not to start. It’s like a playlist, ther are 5 songs, so I click on one, listen to it a little bit, then decide to hear another one. Thats when the problem happens - I want whatever else was playing to stop if any of the other songs are clicked on. So, I’m not sure not starting it is what I’m trying to do.

---

<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: [June 30, 2003, 3:46pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/13 "2003-06-30T15:46:23Z")

</div>

[AS]  
x.stop();  
[/AS]

that will stop sound object x.

so a button that loads a new sound file should obviously stop the other one, correct? think about it how is a sound going to stop unless you stop it

the code i gave you is so that once a song is playing you can’t load that same sound over the exisiting one

---

<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: [June 30, 2003, 5:04pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/14 "2003-06-30T17:04:48Z")

</div>

yess, i get it, it worked - thank you soooooo much!

---

<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: [June 30, 2003, 5:08pm UTC](https://forum.kirupa.com/t/external-mp3-problem/24380/15 "2003-06-30T17:08:16Z")

</div>

no problem
