MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 661

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Using the XMLSocket class
ActionScript provides a built-in XMLSocket class, which lets you open a continuous
connection with a server. A socket connection lets the server publish, or push, information to
the client as soon as that information is available. Without a continuous connection, the
server must wait for an HTTP request. This open connection removes latency issues and is
commonly used for real-time applications such as chats. The data is sent over the socket
connection as one string and should be formatted as XML. You can use the XML class to
structure the data.
To create a socket connection, you must create a server-side application to wait for the socket
connection request and send a response to the SWF file. This type of server-side application
can be written in a programming language such as Java.
The XMLSocket class cannot tunnel through firewalls automatically because, unlike the
Real-Time Messaging Protocol (RTMP), XMLSocket has no HTTP tunneling capability.
If you need to use HTTP tunneling, consider using Flash Remoting or Flash
Communication Server (which supports RTMP) instead.
You can use the
connect()
and from a server over a socket connection. The
connection with a web server port. The
specified in the socket connection.
When you invoke the
server and keeps that connection open until one of the following events happens:
The
method of the XMLSocket class is called.
close()
No more references to the XMLSocket object exist.
Flash Player exits.
The connection is broken (for example, the modem disconnects).
and
methods of the XMLSocket class to transfer XML to
send()
send()
method, Flash Player opens a TCP/IP connection to the
connect()
method establishes a socket
connect()
method passes an XML object to the server
About XML
661

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents