03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

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.

■ Use HTTPS-to-HTTP scripting, rather than HTTP-to-HTTPS scripting. In the scenario<br />

described, you could store the contents of the user's shopping cart in catalog.swf, <strong>and</strong> have<br />

cart.swf manage only the checkout process. At checkout time, cart.swf could retrieve the<br />

cart contents from <strong>ActionScript</strong> variables in catalog.swf. The restriction on HTTP-to-<br />

HTTPS scripting is asymmetrical; although an HTTP-delivered catalog.swf file cannot<br />

safely be allowed to script an HTTPS-delivered cart.swf file, an HTTPS cart.swf file may<br />

script the HTTP catalog.swf file. This approach is more delicate than the all-HTTPS<br />

approach; you must be careful not to trust any SWF file delivered over HTTP, because of<br />

its vulnerability to tampering. For example, when cart.swf retrieves the <strong>ActionScript</strong><br />

variable that describes the cart contents, the <strong>ActionScript</strong> code in cart.swf cannot trust<br />

that the value of this variable is in the format that you expect. You must carefully validate<br />

that the cart contents do not contain invalid data that might lead cart.swf to take an<br />

undesired action. You must also accept the risk that a middle party, by altering catalog.swf,<br />

could supply valid but inaccurate data to cart.swf; for example, by placing items in the<br />

user's cart. The usual checkout process mitigates this risk somewhat by displaying the cart<br />

contents <strong>and</strong> total cost for final approval by the user, but the risk remains present.<br />

Web browsers have enforced separation between HTTPS <strong>and</strong> non-HTTPS files for years, <strong>and</strong><br />

the scenario described illustrates one good reason for this restriction. Flash Player gives you<br />

the ability to work around this security restriction when you absolutely must, but be sure to<br />

consider the consequences carefully before doing so.<br />

For more information, see the following:<br />

■ The Flash Player 9 Security white paper at http://www.adobe.com/go/fp9_0_security<br />

■ The Flash Player 8 Security-Related API white paper at http://www.adobe.com/go/<br />

fp8_security_apis<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Parameters<br />

domain:String - An exact domain name, such as www.myDomainName.com or<br />

store.myDomainName.com. In Flash Player 8, you can pass a wildcard ("*") to<br />

System.security.allowInsecureDomain() to allow all domains, including local hosts,<br />

access to the calling SWF file. Do not use the wildcard unless you are certain that you want to<br />

allow all domains, including local hosts, to access the HTTPS SWF file.<br />

security (System.security) 1079

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

Saved successfully!

Ooh no, something went wrong!