Just modify only the array to add more sounds or to change the number of time each individual sounds repeats:
Code:
var index:Number = 0;
var aSounds:Array = [{sound:"key1", repeat:10}, {sound:"key2", repeat:1}]
function playSound():Void
{
iteration = 0;
snd = new Sound();
snd.attachSound(aSounds[index]["sound"]);
snd.start(0, aSounds[index]["repeat"]);
snd.onSoundComplete = playNextSound;
}
function playNextSound():Void
{
index++;
if(index == aSounds.length) index = 0;
playSound();
}
playSound();