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.

Method summary<br />

Modifiers Signature Description<br />

static allowDomain(domain1:<br />

String) : Void<br />

static allowInsecureDomain(<br />

domain:String) :<br />

Void<br />

static loadPolicyFile(url:S<br />

tring) : Void<br />

Methods inherited from class Object<br />

allowDomain (security.allowDomain method)<br />

public static allowDomain(domain1:String) : Void<br />

Lets SWF files <strong>and</strong> HTML files in the identified<br />

domains access objects <strong>and</strong> variables in the SWF file<br />

that contains the allowDomain() call.<br />

Lets SWF files <strong>and</strong> HTML files in the identified<br />

domains access objects <strong>and</strong> variables in the calling<br />

SWF file, which is hosted by means of the HTTPS<br />

protocol.<br />

Loads a cross-domain policy file from a location<br />

specified by the url parameter.<br />

addProperty (Object.addProperty method), hasOwnProperty<br />

(Object.hasOwnProperty method), isPropertyEnumerable<br />

(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf<br />

method), registerClass (Object.registerClass method), toString<br />

(Object.toString method), unwatch (Object.unwatch method), valueOf<br />

(Object.valueOf method), watch (Object.watch method)<br />

Lets SWF files <strong>and</strong> HTML files in the identified domains access objects <strong>and</strong> variables in the<br />

SWF file that contains the allowDomain() call.<br />

If two SWF files are served from the same domain — for example, http://mysite.com/<br />

movieA.swf <strong>and</strong> http://mysite.com/movieB.swf — then movieA.swf can examine <strong>and</strong> modify<br />

variables, objects, properties, methods, <strong>and</strong> so on in movieB.swf, <strong>and</strong> movieB.swf can do the<br />

same for movieA.swf. This is called cross-movie scripting or simply cross-scripting.<br />

If two SWF files are served from different domains — for example, http://mysite.com/<br />

movieA.swf <strong>and</strong> http://othersite.com/movieB.swf — then, by default, Flash Player does not<br />

allow movieA.swf to script movieB.swf, nor movieB.swf to script movieA.swf. A SWF file<br />

gives SWF files from other domains permission to script it by calling<br />

System.security.allowDomain(). This is called cross-domain scripting. By calling<br />

System.security.allowDomain("mysite.com"), movieB.swf gives movieA.swf permission<br />

to script movieB.swf.<br />

security (System.security) 1071

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

Saved successfully!

Ooh no, something went wrong!