User Guide

LocalConnection 711
The primary methods used to send and receive data are LocalConnection.send() and
LocalConnection.connect(). At its most basic, your code will implement the following
commands; notice that both the
LocalConnection.send() and
LocalConnection.connect() commands specify the same connection name, lc_name:
// 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");
// Code in the sending SWF file
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "methodToExecute", 5, 7);
The simplest way to use a LocalConnection object is to allow communication only between
LocalConnection objects located in the same domain because you won't have security issues.
However, if you need to allow communication between domains, you have several ways to
implement security measures. For more information, see the discussion of the
connectionName parameter in LocalConnection.send() and the
LocalConnection.allowDomain and LocalConnection.domain() entries.
Availability: ActionScript 1.0; Flash Player 6
Property summary
Properties inherited from class Object
constructor (Object.constructor property), __proto__ (Object.__proto__
property), prototype (Object.prototype property), __resolve
(Object.__resolve property)