03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sending_lc = new LocalConnection();<br />

sending_lc.onStatus = function(infoObject:Object) {<br />

switch (infoObject.level) {<br />

case 'status' :<br />

status_ta.text = "LocalConnection connected successfully.";<br />

break;<br />

case 'error' :<br />

status_ta.text = "LocalConnection encountered an error.";<br />

break;<br />

}<br />

};<br />

sending_lc.send("lc_name", "sayHello", name_ti.text);<br />

};<br />

send_button.addEventListener("click", sendListener);<br />

See also<br />

send (LocalConnection.send method), onStatus (System.onStatus h<strong>and</strong>ler)<br />

send (LocalConnection.send method)<br />

public send(connectionName:String, methodName:String, [args:Object]) :<br />

Boolean<br />

Invokes the method named method on a connection opened with the<br />

LocalConnection.connect(connectionName) comm<strong>and</strong> (the receiving LocalConnection<br />

object). The object used with this comm<strong>and</strong> is called the sending LocalConnection object.<br />

The SWF files that contain the sending <strong>and</strong> receiving objects must be running on the same<br />

client computer.<br />

There is a 40 kilobyte limit to the amount of data you can pass as parameters to this<br />

comm<strong>and</strong>. If the comm<strong>and</strong> returns false but your syntax is correct, try dividing the<br />

LocalConnection.send() requests into multiple comm<strong>and</strong>s, each with less than 40K of<br />

data.<br />

As discussed in the entry LocalConnection.connect(), Flash adds the current superdomain<br />

to connectionName by default. If you are implementing communication between different<br />

domains, you need to define connectionName in both the sending <strong>and</strong> receiving<br />

LocalConnection objects in such a way that Flash does not add the current superdomain to<br />

connectionName. You can do this in one of the following two ways:<br />

■ Use an underscore (_) at the beginning of connectionName in both the sending <strong>and</strong><br />

receiving LocalConnection objects. In the SWF file containing the receiving object, use<br />

LocalConnection.allowDomain to specify that connections from any domain will be<br />

accepted. This implementation lets you store your sending <strong>and</strong> receiving SWF files in any<br />

domain.<br />

736 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!