The Sound
class doesn't allow you to perform that operation, the best way to do this is by using a Timer:
var musicTimer:Timer = new Timer(100, 5); // Loop total time(ms), N Loops (+1)
musicTimer.addEventListener(TimerEvent.TIMER, musicTimer_tick);
musicTimer.addEventListener(TimerEvent.TIMER_COMPLETE, musicTimer_complete);
musicTimer.start();
private function musicTimer_complete(e:TimerEvent):void
{
// Last loop stop all sounds
channel.stop();
}
private function musicTimer_tick(e:TimerEvent):void
{
// At each loop, stop and (re)start the sound
channel.stop();
channel = sound.play(5); // 5 is the loop start time
}