我正在尝试在 Animate CC 中构建一个播放影片剪辑的交互,并且按钮在单击后消失。
当影片剪辑在主背景上播放时,我试图暂时禁用其他按钮,但播放效果不佳。
点击处理程序的代码片段:
exportRoot.btn_cook.addEventListener("click", cook_clickHandler.bind(this));
function cook_clickHandler(){
exportRoot.cook.gotoAndPlay(1); //play the info clip
exportRoot.btn_cook.visible = false; //hide button for no replays
disableAll();
}
disableAll();
对画布上的每个按钮执行以下操作:
if(exportRoot.btn_receive.visible == true){
exportRoot.btn_receive.disabled = true;
}
我在试图弄清楚如何正确使用它时遇到了一些麻烦。当我完成交互时,我仍然可以点击按钮,即使我应该禁用它们?
这个演示不会在 GitHub 上加载声音,但它可以正常工作。点击此处查看。