# Working with multiple sound files

**URL:** <https://forum.kirupa.com/t/working-with-multiple-sound-files/280096>\
**Category:** flash\
**Created:** [January 22, 2009, 4:41pm UTC](https://forum.kirupa.com/t/working-with-multiple-sound-files/280096 "2009-01-22T16:41:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![croix](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/croix/32/3421_2.png) [@croix](https://forum.kirupa.com/u/croix)\
**Post date:** [January 22, 2009, 4:41pm UTC](https://forum.kirupa.com/t/working-with-multiple-sound-files/280096/1 "2009-01-22T16:41:23Z")

</div>

I have figured out how to play a sound with AS3, but i cannt figure out how to use multiple sounds. to play a single mp3, i am using this:

```auto
//number that is redefined when the pause button is hit
var pausePoint:Number = 0.00;
//a true or false value that is used to check whether the sound is currently playing
var isPlaying:Boolean;

//think of the soundchannel as a speaker system and the sound as an mp3 player
var soundChannel:SoundChannel = new SoundChannel();
var sound:Sound = new Sound(new URLRequest("Commercial.mp3"));

//you should set the xstop and xplay values to match the instance names of your stop button and play/pause buttons
stopCommercial.addEventListener(MouseEvent.CLICK, clickStop);
playCommercial.addEventListener(MouseEvent.CLICK, clickPlayPause);

soundChannel = sound.play();
isPlaying = true;

function clickPlayPause(evt:MouseEvent) {
	if (isPlaying) {
		pausePoint = soundChannel.position;
		soundChannel.stop();
		isPlaying = false;
	} else if (!isPlaying) {
		soundChannel = sound.play(pausePoint);
		isPlaying = true;
	}
}

function clickStop(evt:MouseEvent) {
	if (isPlaying) {
		soundChannel.stop();
		isPlaying = false;
	}
	pausePoint = 0.00;
}

```

but what I need to do is have 4 different mp3’s, each with its own stop & play button, so the user can play any file they want. These are voice over reels, not music, so each needs its own set of buttons.
