User Guide

LocalConnection class 401
Event handler summary for the LocalConnection class
Constructor for the LocalConnection class
Availability
Flash Player 6.
Usage
new LocalConnection() : LocalConnection
Parameters
None.
Returns
A reference to a LocalConnection object.
Description
Constructor; creates a LocalConnection object.
Example
The following example shows how receiving and sending SWF files create LocalConnnection
objects. The two SWF files can use the same name or different names for their respective
LocalConnection objects. In this example they use different names.
// Code in the receiving SWF file
this.createTextField("result_txt", 1, 10, 10, 100, 22);
result_txt.border = true;
var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.methodToExecute = function(param1:Number, param2:Number) {
result_txt.text = param1+param2;
};
receiving_lc.connect("lc_name");
The following SWF file sends the request to the first SWF file.
// Code in the sending SWF file
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "methodToExecute", 5, 7);
Event handler Description
LocalConnection.allowDomain
Invoked whenever the current (receiving) LocalConnection
object receives a request to invoke a method from a
sending LocalConnection object.
LocalConnection.allowInsecureDomain
Invoked whenever the current (receiving) LocalConnection
object, 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 non-secure protocol.
LocalConnection.onStatus
Invoked after a sending LocalConnection object tries to
send a command to a receiving LocalConnection object.