Hi people, using the code that kgooding 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
*
//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]);
}