目前,我试图在我的Actionscript 3项目中无休止地循环播放声音片段(将mp3导入到库中)。这是我当前的设置:
var sound:Sound = new bgm();
function playSound():void
{
var channel:SoundChannel = sound.play(80);
channel.addEventListener(Event.SOUND_COMPLETE, onComplete);
}
function onComplete(event:Event):void
{
SoundChannel(event.target).removeEventListener(event.type, onComplete);
playSound();
}
//end loop
这不会报告任何错误;但是它也不会播放任何声音。我想念什么吗?我需要将某些东西导入.fla才能注册声音吗?
感谢您的任何帮助
最佳答案
您必须首先调用函数playSound()
。
关于actionscript-3 - ActionScript 3.0;循环播放音频文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37409759/