03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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 (XML.onData h<strong>and</strong>ler)<br />

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

Invoked when XML text has been completely downloaded from the server, or when an error<br />

occurs downloading XML text from a server. This h<strong>and</strong>ler is invoked before the XML is<br />

parsed, <strong>and</strong> you can use it to call a custom parsing routine instead of using the Flash XML<br />

parser. The src parameter is a string that contains XML text downloaded from the server,<br />

unless an error occurs during the download, in which case the src parameter is undefined.<br />

By default, the XML.onData event h<strong>and</strong>ler invokes XML.onLoad. You can override the<br />

XML.onData event h<strong>and</strong>ler with custom behavior, but XML.onLoad is not called unless you<br />

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

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Parameters<br />

src:String - A string or undefined; the raw data, usually in XML format, that is sent by the<br />

server.<br />

Example<br />

The following example shows what the XML.onData event h<strong>and</strong>ler looks like by default:<br />

XML.prototype.onData = function (src:String) {<br />

if (src == undefined) {<br />

this.onLoad(false);<br />

} else {<br />

this.parseXML(src);<br />

this.loaded = true;<br />

this.onLoad(true);<br />

}<br />

}<br />

You can override the XML.onData event h<strong>and</strong>ler to intercept the XML text without parsing<br />

it.<br />

See also<br />

onLoad (XML.onLoad h<strong>and</strong>ler)<br />

XML 1323

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

Saved successfully!

Ooh no, something went wrong!