MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 571

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Also, for files running in Flash Player 7 or later, you can't use this method to let SWF files
hosted using a secure protocol (HTTPS) allow access from SWF files hosted in nonsecure
protocols; you must use System.security.allowInsecureDomain() instead.
Occasionally, you might encounter the following situation: You load a child SWF file from a
different domain and want to allow the child SWF file to script the parent SWF file, but you
don't know the final domain from which the child SWF file will originate. This can happen,
for example, when you use load-balancing redirects or third-party servers.
In this situation, you can use the MovieClip._url property as an argument to this method. For
example, if you load a SWF file into my_mc, you can call
System.security.allowDomain(my_mc._url).
If you do this, be sure to wait until the SWF file in my_mc is loaded, because the _url
property does not have its final, correct value until the file is completely loaded. The best way
to determine when a child SWF finishes loading is to use MovieClipLoader.onLoadComplete.
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 is already loaded
by the time the child loads.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- One or more strings that specify domains that can access objects and
domain1:String
variables in the SWF file that contains the
domains can be formatted in the following ways:
"domain.com"
"http://domain.com"
"http://IPaddress"
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
variables in MovieA. If MovieA didn't contain this call, the Flash security implementation
would prevent MovieB from accessing MovieA's objects and variables.
System.Security.allowDomain()
call, MovieB can access the objects and
allowDomain()
call. The
security (System.security)
571

Advertisement

Table of Contents
loading

Table of Contents