MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 71

Actionscript language reference
Table of Contents

Advertisement

In the following example,
child node
<holding>
<portfolio>
<holding symbol="rich"
qty="75"
price="245.50"
value="18412.50" />
</portfolio>
For more information on XML, see www.w3.org/XML.
Using the XML class
The methods of the ActionScript XML class (for example,
insertBefore()
interpret downloaded XML data.
The following XML class methods send and load XML data to a server by using the HTTP
method:
POST
The
method downloads XML from a URL and places it in an ActionScript
load()
XML object.
The
method encodes the XML object into an XML document and sends it to a
send()
specified URL using the
The
sendAndLoad()
placed in an ActionScript XML object.
For more information, see the
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.
Note: The XMLSocket class cannot tunnel through firewalls automatically because, unlike RTMP
protocol, 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()
from a server over a socket connection. The
with a web server port. The
socket connection.
<portfolio>
, which has the attributes
) let you structure XML data in Flash to send to a server and manipulate and
method. If specified, a browser window displays returned data.
POST
method sends an XML object to a URL. Any returned information is
XML class
and
send()
method passes an XML object to the server specified in the
send()
Sending and loading variables to and from a remote source
is the parent node; it has no attributes and contains the
,
,
symbol
qty
price
appendChild()
entry and Developing Flex Applications.
methods of the XMLSocket class to transfer XML to and
method establishes a socket connection
connect()
, and
:
value
,
removeNode()
, and
71

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents