
Код AS3:
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
var sound:Sound = new Sound();
var soundChannel:SoundChannel;
sound.addEventListener(Event.COMPLETE, onSoundLoadComplete);
sound.load(new URLRequest('test.mp3'));
/** Function onSoundLoadComplete */
function onSoundLoadComplete(e:Event):void{
sound.removeEventListener(Event.COMPLETE, onSoundLoadComplete);
soundChannel = sound.play();
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundChannelSoundComplete);
}
/** Function onSoundChannelSoundComplete */
function onSoundChannelSoundComplete(e:Event):void{
e.currentTarget.removeEventListener(Event.SOUND_COMPLETE, onSoundChannelSoundComplete);
trace('onSoundChannelSoundComplete');
}
http://help.adobe.com/en_US/FlashPla...:soundComplete