# Flash 8 soudbusy command?

**URL:** <https://forum.kirupa.com/t/flash-8-soudbusy-command/218629>\
**Category:** flash\
**Created:** [March 9, 2007, 10:33am UTC](https://forum.kirupa.com/t/flash-8-soudbusy-command/218629 "2007-03-09T10:33:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliecat](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@juliecat](https://forum.kirupa.com/u/juliecat)\
**Post date:** [March 9, 2007, 10:33am UTC](https://forum.kirupa.com/t/flash-8-soudbusy-command/218629/1 "2007-03-09T10:33:58Z")

</div>

Hi people, using the code that [kgooding](http://www.kirupa.com/forum/member.php?u=45733) and Barn showed me, I’ve created a random sound picker. There is a problem though in that it can only handle one random sound at a time. If you click with the mouse the second time within the runtime of the movie it plays the same sound, you have to restart the SWF it will play a new randomised sound.  
Does anyone know how to pick a randomised sound within the runtime of the same movie. I Lingo I would use the soundbusy command to test which sound was being played and load a new one. Is this possible in AS, I can’t find any documentation that suggests it can.

best  
julie  
\*

```auto
//linked sounds
var songs = new Array("sound1", "sound2", "sound3", "sound4", "sound5");
var song:Sound = new Sound();
var randSongNum:Number;

button_mc.onPress = function() {
   randSongNum =(random(5));
   song.attachSound(songs[randSongNum]);
   
   song.start();
   song.setVolume(100);
}

button_mc.onRelease = function() {

    var song:Sound = new Sound();
var randSongNum:Number;
   randSongNum =(random(5));
   song.attachSound(songs[randSongNum]);
}

```
