将 Flash 与麦克风或相机一起使用时,系统会提示用户允许访问这些设备。这是通过内置的安全设置面板完成的。
当用户单击安全设置面板的关闭按钮时,是否可以通过事件处理程序通知?这似乎不太可能……
对于麦克风,当用户更改安全面板中的设置时可能会收到状态事件,但在用户仍然打开面板时会触发此事件。
最佳答案
我在尝试寻找解决方案时偶然发现了这一点。
Flash Player bug report WITH WORKAROUND
我还没有测试解决方法,但它应该仍然有效?祝你好运。
编辑 :
对于无法/不会访问 Adobe 错误跟踪器的任何人,以下是 Philippe Piernot 最初发布的解决方法:
var closed:Boolean = true;
var dummy:BitmapData;
dummy = new BitmapData(1, 1);
try
{
// Try to capture the stage: triggers a Security error when the settings dialog box is open
dummy.draw(stage);
}
catch (error:Error)
{
closed = false;
}
dummy.dispose();
dummy = null;
关于Flash 安全设置面板 - 监听关闭事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6945055/