Example
The following example displays a status message about whether the SWF file connects to
another local connection object called
TextArea instance called
display content.
var sending_lc:LocalConnection;
var sendListener:Object = new Object();
sendListener.click = function(evt:Object) {
sending_lc = new LocalConnection();
sending_lc.onStatus = function(infoObject:Object) {
switch (infoObject.level) {
case 'status' :
status_ta.text = "LocalConnection connected successfully.";
break;
case 'error' :
status_ta.text = "LocalConnection encountered an error.";
break;
}
};
sending_lc.send("lc_name", "sayHello", name_ti.text);
};
send_button.addEventListener("click", sendListener);
See also
send (LocalConnection.send method)
send (LocalConnection.send method)
public send(connectionName:String, methodName:String, [args:Object]) :
Boolean
Invokes the method named
LocalConnection.connect(connectionName)
object). The object used with this command is called the sending LocalConnection object.
The SWF files that contain the sending and receiving objects must be running on the same
client computer.
There is a 40 kilobyte limit to the amount of data you can pass as parameters to this
command. If the command returns
LocalConnection.send()
data.
lc_name
and a Button instance called
status_ta
,
onStatus (System.onStatus handler)
on a connection opened with the
method
but your syntax is correct, try dividing the
false
requests into multiple commands, each with less than 40K of
. A TextInput component called
send_button
command (the receiving LocalConnection
, a
name_ti
are used to
LocalConnection
727
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?