XMLSocket
1347
gotoAndStop("waitForConnection");
}
See also
connect (XMLSocket.connect method)
,
function statement
onData (XMLSocket.onData handler)
onData = function(src:String) {}
Invoked when a message has been downloaded from the server, terminated by a zero (0) byte.
You can override
XMLSocket.onData
to intercept the data sent by the server without parsing
it as XML. This is a useful if you're transmitting arbitrarily formatted data packets, and you'd
prefer to manipulate the data directly when it arrives, rather than have Flash Player parse the
data as XML.
By default, the
XMLSocket.onData
method invokes the
XMLSocket.onXML
method. If you
override
XMLSocket.onData
with custom behavior,
XMLSocket.onXML
is not called unless
you call it in your implementation of
XMLSocket.onData
.
Availability:
ActionScript 1.0; Flash Player 5
Parameters
src
:String
- A string containing the data sent by the server.
Example
In this example, the
src
parameter is a string containing XML text downloaded from the
server. The zero (0) byte terminator is not included in the string.
XMLSocket.prototype.onData = function (src) {
this.onXML(new XML(src));
}
onXML (XMLSocket.onXML handler)
onXML = function(src:XML) {}
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
onXML
method.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...