MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1060

Actionscript 2.0 language reference
Table of Contents

Advertisement

Occasionally, you may 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 come. This can happen, for
example, when you use load-balancing redirects or third-party servers.
In this situation, you can use the
For example, if you load a SWF file into the movie clip
System.security.allowDomain(my_mc._url)
SWF file in
begins loading, because the
my_mc
value until this time. The best way to determine when a child SWF file has begun loading is
to use
MovieClipLoader.onLoadStart
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)
don't have to wait for the parent SWF file to load; the parent will already be loaded by the
time the child loads.
If you are publishing for Flash Player 8, you can also handle these situations by calling
System.security.allowDomain("*")
shortcut, because it allows the calling SWF file to be accessed by any other SWF file from any
domain. It is usually safer to use the
For more information, see the following:
Chapter 17, "Understanding Security," in Learning ActionScript 2.0 in Flash
The Flash Player 8 Security white paper at http://www.macromedia.com/go/fp8_security
The Flash Player 8 Security-Related API white paper at http://www.macromedia.com/go/
fp8_security_apis
Availability: ActionScript 1.0; Flash Player 6 - Behavior changed in Flash Player 7; behavior
changed in Flash Player 8.
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"
1060 ActionScript classes
property as a parameter to this method.
MovieClip._url
. If you do this, be sure to wait until the
property does not have its final, correct
_url
.
. However, this can sometimes be a dangerous
property.
_url
System.Security.allowDomain()
, you can call
my_mc
from the child SWF. You
call. The

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents