Reliable way to know if the user allows storage of Local Shared Objects (LSO)
There is a small feature I 开发者_JAVA百科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.
According to the ShardObject reference, SharedObject.getLocal()
throws an Error
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.
精彩评论