User Guide

334 Chapter 6: ActionScript Core Classes
};
my_lc.allowInsecureDomain = function(sendingDomain:String) {
return (sendingDomain == this.domain());
}
my_lc.sayHello = function(name:String) {
welcome_txt.text = "Hello, "+name;
};
my_lc.connect("lc_name");
See also
LocalConnection.allowDomain, LocalConnection.connect()
LocalConnection.close()
Availability
Flash Player 6.
Usage
receiving_lc.close() : Void
Parameters
None.
Returns
Nothing.
Description
Method; closes (disconnects) a LocalConnection object. Issue this command when you no
longer want the object to accept commands—for example, when you want to issue a
LocalConnection.connect() command using the same connectionName parameter in
another SWF file.
Example
The following example closes a connection called receiving_lc when you click a Button
component instance called
close_button:
this.createTextField("welcome_txt", this.getNextHighestDepth(), 10, 10, 100,
22);
this.createTextField("status_txt", this.getNextHighestDepth(), 10, 42,
100,44);
var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.sayHello = function(name:String) {
welcome_txt.text = "Hello, "+name;
};
receiving_lc.connect("lc_name");
var closeListener:Object = new Object();
closeListener.click = function(evt:Object) {
receiving_lc.close();
status_txt.text = "connection closed";