Xmlsocket.onxml - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

XMLSocket.onXML

Availability
Flash Player 5.
Usage
myXMLSocket.onXML = function(object:XML) {
// your statements here
}
Parameter
An XML object that contains a parsed XML document received from a server.
object
Returns
Nothing.
Description
Event handler; invoked by Flash Player when the specified XML object containing an XML
document arrives over an open XMLSocket connection. An XMLSocket connection can be used
to transfer an unlimited number of XML documents between the client and the server. Each
document is terminated with a zero (0) byte. When Flash Player receives the zero byte, it parses all
the XML received since the previous zero byte or since the connection was established if this is the
first message received. Each batch of parsed XML is treated as a single XML document and passed
to the
method.
onXML
The default implementation of this method performs no actions. To override the default
implementation, you must assign a function containing actions that you define.
Example
The following function overrides the default implementation of the
chat application. The function
element,
MESSAGE
<MESSAGE USER="John" TEXT="Hello, my name is John!" />.
var socket:XMLSocket = new XMLSocket();
The following function
the message received by the user:
socket.onXML = function (doc) {
var e = doc.firstChild;
if (e != null && e.nodeName == "MESSAGE") {
displayMessage(e.attributes.user, e.attributes.text);
}
}
See also
function
1068
Chapter 2: ActionScript Language Reference
myOnXML
, in the following format.
displayMessage()
instructs the chat application to recognize a single XML
is assumed to be a user-defined function that displays
method in a simple
onXML

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents