User Guide
System.security.allowDomain() 845
The opposite situation can also occur; that is, you might create a child SWF file that wants to
allow its parent to script it, but doesn’t know what the domain of its parent will be. In this
situation, call
System.security.allowDomain(_parent._url) from the child SWF. In this
situation, you don’t have to wait for the parent SWF file to load; the parent will already be loaded
by the time the child loads.
Example
The SWF file located at www.macromedia.com/MovieA.swf contains the following lines:
System.security.allowDomain("www.shockwave.com");
loadMovie("http://www.shockwave.com/MovieB.swf", my_mc);
Because MovieA contains the allowDomain() command, MovieB can access the objects and
variables in MovieA. If MovieA didn’t contain this command, the Flash security implementation
would prevent MovieB from accessing MovieA’s objects and variables.
See also
MovieClip._url, MovieClipLoader.onLoadComplete, _parent,
System.security.allowInsecureDomain()