嗨,我是html5画布的初学者。我尝试了所有关于如何停止音乐的代码,但即使我点击播放/暂停按钮,它也会继续播放。
代码:
var comp = this;
var pause = "false";
//var req:URLRequest = new URLRequest("pokemon.mp3");
//var sound:Sound = new Sound();
//var controller:SoundChannel;
comp.push_btn.addEventListener("click", stopAnimate);
function stopAnimate()
{
if(pause == "true")
{
comp.stop();
//controller.stop();
pause = "false"
}
else
{
comp.play();
//controller = sound.play();
pause = "true";
}
}
答案 0 :(得分:0)
{{1}}