# How to play mp3 without bugs?

**URL:** https://forum.kirupa.com/t/how-to-play-mp3-without-bugs/57558
**Category:** flash
**Created:** [July 14, 2004, 9:01am UTC](https://forum.kirupa.com/t/how-to-play-mp3-without-bugs/57558 "2004-07-14T09:01:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![janice\_2k](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@janice\_2k](https://forum.kirupa.com/u/janice_2k)
#### Post date: [July 14, 2004, 9:01am UTC](https://forum.kirupa.com/t/how-to-play-mp3-without-bugs/57558/1 "2004-07-14T09:01:37Z")

</div>

Dear Gurus and members,  
I am a newbie in Actionscript and programming. I am doing a button that will playback server and client side mp3 files alternately. Though, there are some bugs that I am not sure how should I solve. The following is the code I placed on the button:

```auto

on(release){
var iddiscussion = 1;
var numberFile = 3;
 
function discussion() {
server = new Sound();
serverFile = "PE14_1d"+iddiscussion+".mp3";
server.attachSound(serverFile); //server side mp3
server.start(0, 0);
server.onSoundComplete = function () {
	 client = new Sound();
	 clientFile ="file:///c:/program files/sound recording/audiorecorder/test"+iddiscussion+".mp3";
	 client.onLoad = function(success){ //define conditions for success first
		 if(success){
			 this.start();
		 }else{ //skip to the next file
			 if(iddiscussion < numberFile) { //no longer dependent on client.onSoundComplete
		 iddiscussion++;
			 discussion();
		 }
		 }
	 }
	 client.loadSound(clientFile, true); //load client mp3
	 client.onSoundComplete = function () {	//doesn't run if not success...
		 if(iddiscussion < numberFile) {	 
		iddiscussion++;
			 discussion();
		  }
	 }
}
}
discussion();
}

```

It works fine and will not terminate when one of the mp3 at client side (example: test2.mp3 is deleted from the client’s computer) does not exist. It will proceed to the following mp3 files smoothly. However, there is an error displayed when I tested the movie. The error was "Error opening URL “file:///c:/program files/sound recording/audiorecorder/test2.mp3”. I wonder is there any ways to solve this?

I would be glad if someone could guide me. Looking forward to some reply soon.

Thanks in advance,  
Janice
