我实现了一个小功能,可以利用本地共享对象正常工作。
如果用户因为拒绝访问该计算机来写入本地共享对象而无法使用上述功能,我希望能够帮助用户进行自我诊断,并指示他解决该问题(如果该问题适用于他)。
我正在寻找类似于 Microphone 类(http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html)或 Camera 类的静音属性的内容。
There is a small feature I have implemented that makes uses of the Local Shared Objects to work properly.
I wish to be able to help the user self-diagnose if he is unable to use the said feature because he refused access for this computer to writing local shared objects and give him instructions to work around the issue if it applies to him.
I'm looking for something similar to the muted property of the Microphone class (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html) or the Camera class.
发布评论
评论(1)
根据 ShardObject 引用,如果用户将 Flash Player 设置为不允许共享对象,则
SharedObject.getLocal()
会引发Error
。将对所述函数的探测调用包装在 try/catch 块中,您就会知道是否可以依赖它们。由于我不确定这是否涵盖所有情况(例如,共享对象被第三方浏览器插件阻止),因此我尝试存储并重新加载一些测试数据。According to the ShardObject reference,
SharedObject.getLocal()
throws anError
if the user has set the Flash Player to not allow Shared Objects. Wrap a probing call to said function in a try/catch block and you'll know whether or not you can rely on them. Since I'm not sure if that covers all cases (e.g. Shared Objects being blocked by a third party browser add-on), I'd try to store and reload some test data.