User Guide
Storing local data 393
{
trace(i + ":\t" + so.data[i]);
}
Creating a secure SharedObject
When you create either a local or remote SharedObject using getLocal() or getRemote(),
there is an optional parameter named
secure that determines whether access to this shared
object is restricted to SWF files that are delivered over an HTTPS connection. If this
parameter is set to
true and your SWF file is delivered over HTTPS, Flash Player creates a
new secure shared object or gets a reference to an existing secure shared object. This secure
shared object can be read from or written to only by SWF files delivered over HTTPS that call
SharedObject.getLocal() with the secure parameter set to true. If this parameter is set to
false and your SWF file is delivered over HTTPS, Flash Player creates a new shared object or
gets a reference to an existing shared object.
This shared object can be read from or written to by SWF files delivered over non-HTTPS
connections. If your SWF file is delivered over a non-HTTPS connection and you try to set
this parameter to
true, the creation of a new shared object (or the access of a previously
created secure shared object) fails, an error is thrown, and the shared object is set to
null. If
you attempt to run the following snippet from a non-HTTPS connection, the
SharedObject.getLocal() method will throw an error, as shown in the following snippet:
try
{
var so:SharedObject = SharedObject.getLocal("contactManager", null,
true);
}
catch (error:Error)
{
trace("Unable to create SharedObject.");
}
Regardless of the value of this parameter, the created shared objects count toward the total
amount of disk space allowed for a domain.