13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Security<br />

For more information<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

For more information on outbound URL access, see the following <strong>en</strong>tries in the ActionScript 3.0 Refer<strong>en</strong>ce for the<br />

Adobe Flash Platform:<br />

The flash.system.fscommand() function<br />

The call() method of the ExternalInterface class<br />

The flash.net.navigateToURL() function<br />

Shared objects<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

Flash Player provides the ability to use shared objects, which are ActionScript objects that persist outside of a SWF file,<br />

either locally on a user’s file system or remotely on an RTMP server. Shared objects, like other media in Flash Player,<br />

are partitioned into security sandboxes. However, the sandbox model for shared objects is somewhat differ<strong>en</strong>t, because<br />

shared objects are not resources that can ever be accessed across domain boundaries. Instead, shared objects are always<br />

retrieved from a shared object store that is particular to the domain of each SWF file that calls methods of the<br />

SharedObject class. Usually a shared object store is ev<strong>en</strong> more particular than a SWF file’s domain: by default, each<br />

SWF file uses a shared object store particular to its <strong>en</strong>tire origin URL. For more information on shared objects, see<br />

“Shared objects” on page 700.<br />

A SWF file can use the localPath parameter of the SharedObject.getLocal() and SharedObject.getRemote()<br />

methods to use a shared object store associated with only a part of its URL. In this way, the SWF file can permit sharing<br />

with other SWF files from other URLs. Ev<strong>en</strong> if you pass '/' as the localPath parameter, this still specifies a shared<br />

object store particular to its own domain.<br />

Users can restrict shared object access by using the Flash Player Settings dialog box or the Settings Manager. By default,<br />

shared objects can be created up to a maximum of 100 KB of data per domain. Administrative users and users can also<br />

place restrictions on the ability to write to the file system. For more information, see “Administrator controls” on<br />

page 1037 and “User controls” on page 1039.<br />

You can specify that a shared object is secure, by specifying true for the secure parameter of the<br />

SharedObject.getLocal() method or the SharedObject.getRemote() method. Note the following about the<br />

secure parameter:<br />

If this parameter is set to true, Flash Player creates a new secure shared object or gets a refer<strong>en</strong>ce to an existing<br />

secure shared object. This secure shared object can be read from or writt<strong>en</strong> to only by SWF files delivered over<br />

HTTPS that call SharedObject.getLocal() with the secure parameter set to true.<br />

If this parameter is set to false, Flash Player creates a new shared object or gets a refer<strong>en</strong>ce to an existing shared<br />

object that can be read from or writt<strong>en</strong> to by SWF files delivered over non-HTTPS connections.<br />

If the calling SWF file is not from an HTTPS URL, specifying true for the secure parameter of the<br />

SharedObject.getLocal() method or the SharedObject.getRemote() method results in a SecurityError<br />

exception.<br />

Last updated 6/6/2012<br />

1063

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!