ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > LocalConnection > LocalConnection constructor | |||
public LocalConnection()
Creates a LocalConnection object.
Availability: ActionScript 1.0; Flash Player 6
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);
connect (LocalConnection.connect method), send (LocalConnection.send method)
|
|
|
|