EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Close (Localconnection.close Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
718 ActionScript classes
my_lc.sayHello = function(name:String) {
welcome_txt.text = "Hello, "+name;
};
my_lc.connect("lc_name");
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method used in
this example.
See also
allowDomain (LocalConnection.allowDomain handler), connect
(LocalConnection.connect method)
close (LocalConnection.close method)
public close() : Void
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.
Availability: ActionScript 1.0; Flash Player 6
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";
};
close_button.addEventListener("click", closeListener);

Table of Contents

Related product manuals