MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 436

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

LocalConnection.allowDomain
Availability
Flash Player 6; behavior changed in Flash Player 7.
Usage
receiving_lc.allowDomain = function([sendingDomain]) {
// Your statements here return true or false
}
Parameters
sendingDomain
sending LocalConnection object.
Returns
Nothing.
Description
Event handler; invoked whenever
sending LocalConnection object. Flash expects the code you implement in this handler to return
a Boolean value of
sending object is ignored, and the method is not invoked.
Use this command to explicitly permit LocalConnection objects from specified domains, or from
any domain, to execute methods of the receiving LocalConnection object. If you don't declare the
sendingDomain
code in your handler would be simply
probably want to compare the value of
accept commands. The following examples illustrate both of these implementations.
In files running in Flash Player 6, the
caller. In files running in Flash Player 7 or later, the
domain of the caller. In the latter case, to allow access by SWF files hosted at either
www.domain.com or store.domain.com, you must explicitly allow access from both domains.
// For Flash Player 6
receiving_lc.allowDomain = function(sendingDomain) {
return(sendingDomain=="domain.com");
}
// Corresponding commands to allow access by SWF files
// that are running in Flash Player 7 or later
receiving_lc.allowDomain = function(sendingDomain) {
return(sendingDomain=="www.domain.com" ||
sendingDomain=="store.domain.com");
}
Also, for files running in Flash Player 7 or later, you can't use this method to allow SWF files
hosted using a secure protocol (HTTPS) to permit access from SWF files hosted in nonsecure
protocols; you must use the
436
Chapter 12: ActionScript Dictionary
An optional parameter specifying the domain of the SWF file containing the
receiving_lc
or
. If the handler doesn't return
true
false
parameter, you probably want to accept commands from any domain, and the
return true
sendingDomain
LocalConnection.allowInsecureDomain
receives a request to invoke a method from a
. If you do declare
with domains from which you want to
sendingDomain
parameter contains the superdomain of the
sendingDomain
, the request from the
true
sendingDomain
parameter contains the exact
event handler instead.
, you

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents