03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

onData (XMLSocket.onData h<strong>and</strong>ler)<br />

onData = function(src:String) {}<br />

Invoked when a message is downloaded from the server <strong>and</strong> terminated by a zero (0) byte.<br />

You can override the XMLSocket.onData event h<strong>and</strong>ler to intercept data that the server sends<br />

without parsing it as XML. This capability is useful if you're transmitting arbitrarily<br />

formatted data packets, <strong>and</strong> you'd prefer to manipulate the data directly when it arrives,<br />

rather than have Flash Player parse the data as XML.<br />

By default, the XMLSocket.onData method invokes the XMLSocket.onXML method. If you<br />

override XMLSocket.onData with custom behavior, XMLSocket.onXML is not called unless<br />

you call it in your implementation of XMLSocket.onData.<br />

Parameters<br />

src:String - A string containing data that the server sends.<br />

Example<br />

In this example, the src parameter is a string containing XML text downloaded from the<br />

server. The zero (0) byte terminator is not included in the string.<br />

XMLSocket.prototype.onData = function (src) {<br />

this.onXML(new XML(src));<br />

}<br />

onXML (XMLSocket.onXML h<strong>and</strong>ler)<br />

onXML = function(src:XML) {}<br />

Invoked by the Flash Lite player when the specified XML object containing an XML<br />

document arrives over an open XMLSocket connection. An XMLSocket connection can be<br />

used to transfer an unlimited number of XML documents between the client <strong>and</strong> the server.<br />

Each document is terminated with a zero (0) byte. When the Flash Lite player receives the<br />

zero byte, it parses all the XML received since the previous zero byte or since the connection<br />

was established if this is the first message received. Each batch of parsed XML is treated as a<br />

single XML document <strong>and</strong> passed to the onXML() method.<br />

The default implementation of this method performs no actions. To override the default<br />

implementation, you must assign a function containing actions that you define.<br />

Parameters<br />

src:XML - An XML object that contains a parsed XML document received from a server.<br />

720 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!