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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Security<br />

Security sandboxes<br />

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

Cli<strong>en</strong>t computers can obtain individual files containing code, cont<strong>en</strong>t, and data from a number of sources, such as<br />

from external websites, from a local file system, or from an installed AIR application. The Flash Player and AIR<br />

runtimes individually assign code files and other resources, such as shared objects, bitmaps, sounds, videos, and data<br />

files, to security sandboxes based on their origin wh<strong>en</strong> they are loaded. The following sections describe the rules,<br />

<strong>en</strong>forced by the runtimes, that govern what a code or cont<strong>en</strong>t executing within a giv<strong>en</strong> sandbox can access.<br />

For more information on Flash Player security, see the Flash Player Developer C<strong>en</strong>ter topic “Security” at<br />

www.adobe.com/go/devnet_security_<strong>en</strong>.<br />

Remote sandboxes<br />

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

The Flash Player and AIR runtimes classify assets (including SWF files) from the Internet in separate sandboxes that<br />

correspond to their domain of origin. For example, assets loaded from example.com will be placed into a differ<strong>en</strong>t<br />

security sandbox than assets loaded from foo.org. By default, these files are authorized to access any resources from<br />

their own server. Remote SWF files can be allowed to access additional data from other domains by explicit website<br />

and author permissions, such as URL policy files and the Security.allowDomain() method. For details, see<br />

“Website controls (policy files)” on page 1040 and “Author (developer) controls” on page 1043.<br />

Remote SWF files cannot load any local files or resources.<br />

For more information on Flash Player security, see the Flash Player Developer C<strong>en</strong>ter topic “Security” at<br />

www.adobe.com/go/devnet_security_<strong>en</strong>.<br />

Local sandboxes<br />

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

Local file describes any file that is refer<strong>en</strong>ced by using the file: protocol or a Universal Naming Conv<strong>en</strong>tion (UNC)<br />

path. Local SWF files are placed into one of four local sandboxes:<br />

The local-with-filesystem sandbox—For security purposes, the Flash Player and AIR runtimes place all local files<br />

in the local-with-file-system sandbox, by default. From this sandbox, executable code can read local files (by using<br />

the URLLoader class, for example), but cannot communicate with the network in any way. This assures the user<br />

that local data cannot be leaked out to the network or otherwise inappropriately shared.<br />

The local-with-networking sandbox—Wh<strong>en</strong> compiling a SWF file, you can specify that it has network access wh<strong>en</strong><br />

run as a local file (see “Setting the sandbox type of local SWF files” on page 1036).These files are placed in the localwith-networking<br />

sandbox. SWF files that are assigned to the local-with-networking sandbox forfeit their local file<br />

access. In return, the SWF files are allowed to access data from the network. However, a local-with-networking<br />

SWF file is still not allowed to read any network-derived data unless permissions are pres<strong>en</strong>t for that action,<br />

through a URL policy file or a call to the Security.allowDomain() method. In order to grant such permission, a<br />

URL policy file must grant permission to all domains by using or by using<br />

Security.allowDomain("*"). For more information, see “Website controls (policy files)” on page 1040 and<br />

“Author (developer) controls” on page 1043.<br />

Last updated 6/6/2012<br />

1033

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

Saved successfully!

Ooh no, something went wrong!