User Guide

Socket connections 385
If you implement communication between SWF files in different domains, you specify a
connectionName parameter that begins with an underscore (_). Specifying the underscore
makes the SWF file with the receiving LocalConnection object more portable between
domains. Here are the two possible cases:
If the string for connectionName does not begin with an underscore (_), Flash Player adds
a prefix with the superdomain name and a colon (for example,
myDomain:connectionName). Although this ensures that your connection does not
conflict with connections of the same name from other domains, any sending
LocalConnection objects must specify this superdomain (for example,
myDomain:connectionName). If you move the SWF file with the receiving
LocalConnection object to another domain, Flash Player changes the prefix to reflect the
new superdomain (for example,
anotherDomain:connectionName). All sending
LocalConnection objects have to be manually edited to point to the new superdomain.
If the string for connectionName begins with an underscore (for example,
_connectionName), Flash Player does not add a prefix to the string. This means the
receiving and sending LocalConnection objects will use identical strings for
connectionName. If the receiving object uses LocalConnection.allowDomain() to
specify that connections from any domain will be accepted, you can move the SWF file
with the receiving LocalConnection object to another domain without altering any
sending LocalConnection objects.
Socket connections
There are two different types of socket connections possible in ActionScript 3.0: XML socket
connections and binary socket connections. An XML socket lets you connect to a remote
server and create a server connection that remains open until explicitly closed. This lets you
exchange XML data between a server and client without having to continually open new
server connections. Another benefit of using an XML socket server is that the user doesnt
need to explicitly request data. You can send data from the server without requests, and you
can send data to every client connected to the XML socket server.
A binary socket connection is similar to an XML socket except that the client and server dont
need to exchange XML packets specifically. Instead, the connection can transfer data as binary
information. This allows you to connect to a wide range of services, including mail servers
(POP3, SMTP, and IMAP), and news (NNTP) servers.