Я не уверен, что понимаю все, что вы написали, но как насчет этого:
package test
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
public class SoundTest extends MovieClip
{
private var files : Array = [ "file1.mp3", "file2.mp3", "file3.mp3" ];
private var sounds : Array = [];
private var count : int = 0;
private var channel : SoundChannel;
public function musicOff () : void
{
if (channel != null)
{
channel.removeEventListener( Event.SOUND_COMPLETE, onSoundComplete );
channel.stop( );
channel = null;
}
}
public function musicOn () : void
{
if (sounds[count] == null) loadSound( );
else playLoadedSound( );
}
private function loadSound () : void
{
var sound : Sound = new Sound( );
sound.addEventListener( Event.COMPLETE, onSoundLoaded );
sound.load( new URLRequest( files[count] ) );
}
private function playLoadedSound () : void
{
channel = sounds[count].play( );
channel.addEventListener( Event.SOUND_COMPLETE, onSoundComplete );
}
private function onSoundComplete (ev : Event) : void
{
channel = null;
count++;
if (count >= files.length) count = 0;
musicOn( );
}
private function onSoundLoaded (ev : Event) : void
{
var snd : Sound = ev.target as Sound;
sounds.push( snd );
channel = snd.play( );
channel.addEventListener( Event.SOUND_COMPLETE, onSoundComplete );
}
public function SoundTest ()
{
musicOn( );
}
}
}
(кстати, вы не можете воспроизводить звук, пока он не загружен.перезагрузите, когда mp3 находится в кэше браузера.)