406
Chapter 2: ActionScript Language Reference
LocalConnection.allowInsecureDomain
Availability
Flash Player 7.
Usage
receiving_lc
.allowInsecureDomain = function([
sendingDomain:String
])
: Boolean
{
// Your statements here return true or false
}
Parameters
sendingDomain
A string that represents an optional parameter specifying the domain of the
SWF file that contains the sending LocalConnection object.
Returns
A Boolean value.
Description
Event handler; invoked whenever
receiving_lc
, which is in a SWF file hosted at a domain
using a secure protocol (HTTPS), receives a request to invoke a method from a sending
LocalConnection object that is in a SWF file hosted at a nonsecure protocol. Flash expects the
code you implement in this handler to return a Boolean value of
true
or
false
. If the handler
doesn’t return
true
, the request from the sending object is ignored, and the method is
not invoked.
By default, SWF files hosted using the HTTPS protocol can be accessed only by other SWF files
hosted using the HTTPS protocol. This implementation maintains the integrity provided by the
HTTPS protocol.
Using this method to override the default behavior is not recommended, as it compromises
HTTPS security. However, you might need to do so, for example, if you need to permit access to
HTTPS files published for Flash Player 7 or later from HTTP files published for Flash Player 6.
A SWF file published for Flash Player 6 can use the
LocalConnection.allowDomain
event handler
to permit HTTP to HTTPS access. However, because security is implemented differently in
Flash Player 7, you must use the
LocalConnection.allowInsecureDomain()
method to permit
such access in SWF files published for Flash Player 7 or later.
Example
The following example allows connections from the current domain or from
www.macromedia.com, or allows insecure connections only from the current domain.
this.createTextField("welcome_txt", this.getNextHighestDepth(), 10, 10, 100,
20);
var my_lc:LocalConnection = new LocalConnection();
my_lc.allowDomain = function(sendingDomain:String) {
domain_txt.text = sendingDomain;
return (sendingDomain == this.domain() || sendingDomain ==
"www.macromedia.com");
Summary of Contents for FLASH MX
Page 1: ...ActionScript Language Reference ...
Page 20: ...20 Contents ...
Page 24: ...24 Chapter 1 Introduction ...
Page 145: ...Button onKeyDown 145 See also Button onKeyUp ...
Page 202: ...202 Chapter 2 ActionScript Language Reference See also break default strict equality switch ...
Page 282: ...282 Chapter 2 ActionScript Language Reference See also break continue while ...
Page 383: ...LoadVars addRequestHeader 383 See also XML addRequestHeader ...
Page 388: ...388 Chapter 2 my_lv load place a valid URL pointing to a text file here ...
Page 463: ...Microphone setRate 463 See also Microphone rate ...
Page 469: ...Microphone silenceLevel 469 See also Microphone gain Microphone setSilenceLevel ...
Page 480: ...480 Chapter 2 ActionScript Language Reference See also Mouse addListener ...
Page 529: ...MovieClip globalToLocal 529 See also MovieClip getBounds MovieClip localToGlobal ...
Page 612: ...612 Chapter 2 ActionScript Language Reference See also MovieClipLoader onLoadStart ...
Page 623: ...NetConnection class 623 See also NetStream class Video attachVideo ...
Page 649: ...Number 649 See also NaN Number class ...
Page 679: ...on 679 on release trace X this _x trace Y this _y stopDrag See also onClipEvent ...
Page 683: ...onUpdate 683 buttonLabel textColor my_mc labelColor ...
Page 788: ...788 Chapter 2 ActionScript Language Reference See also private public ...
Page 1001: ...Video height 1001 my_mc _height my_mc my_video height See also MovieClip _height Video width ...
Page 1022: ...1022 Chapter 2 ActionScript Language Reference See also XML createElement ...
Page 1057: ...XML xmlDecl 1057 See also XML docTypeDecl XML toString ...
Page 1070: ...1070 Chapter 2 ActionScript Language Reference ...
Page 1104: ...1104 Appendix Deprecated Language Elements ...