我在 Adobe 论坛上找到了一些关于在“flash html5 mycanva.fla”中编码 MouseOver 以在悬停按钮时触发声音的问题的答案。看这里
问题是,当您将鼠标移出按钮时,当停止播放声音时,我被“MouseOut 功能”卡住了!
最重要的是在鼠标悬停时暂停声音,并在鼠标悬停时从暂停点开始播放。但我不想显得太贪婪;-)
这是我在 my_flash_canva.fla 中使用的代码:
var frequency = 3;
stage.enableMouseOver(frequency);
this.mybutton.addEventListener("mouseover", fl_MouseOverHandler);
function fl_MouseOverHandler(){
playSound("monstres");
//linked sound from library by dble clicking on it and named a link in the blank area.Indeed, the action script panel in "mysound" properties panel is greyed..
//works like a charm
}
this.mybutton.addEventListener("mouseout", fl_MouseOutHandler);
function fl_MouseOutHandler() {
stopSound("monstres");
// doesn't work
}
使用 flash pro cc 2014。我想我一定是遗漏了一些东西或语法错误,但在我看来,与 playSound("xxx") 一起使用的东西应该与 stopSound("xxx") 一起使用。但显然事情没那么简单。欢迎任何线索,我将不胜感激。非常感谢。
奥利维尔。