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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If no DOCTYPE declaration was encountered during a parse operation, the XML.docTypeDecl<br />

property is set to undefined. The XML.toString() method outputs the contents of<br />

XML.docTypeDecl immediately after the XML declaration stored in XML.xmlDecl, <strong>and</strong><br />

before any other text in the XML object. If XML.docTypeDecl is undefined, no DOCTYPE<br />

declaration is output.<br />

Example<br />

The following example uses the XML.docTypeDecl property to set the DOCTYPE declaration<br />

for an XML object:<br />

my_xml.docTypeDecl = "";<br />

See also<br />

xmlDecl (XML.xmlDecl property)<br />

getBytesLoaded (XML.getBytesLoaded method)<br />

public getBytesLoaded() : Number<br />

Returns the number of bytes loaded (streamed) for the XML document. You can compare the<br />

value of getBytesLoaded() with the value of getBytesTotal() to determine what<br />

percentage of an XML document has loaded.<br />

Returns<br />

Number - An integer that indicates the number of bytes loaded.<br />

Example<br />

The following example shows how to use the XML.getBytesLoaded() method with the<br />

XML.getBytesTotal() method to trace the progress of an XML.load() comm<strong>and</strong>. You must<br />

replace the URL parameter of the XML.load() comm<strong>and</strong> so that the parameter refers to a<br />

valid XML file using HTTP. If you attempt to use this example to load a local file that resides<br />

on your hard disk, this example will not work properly because in test movie mode Flash<br />

Player loads local files in their entirety.<br />

// create a new XML document<br />

var doc:XML = new XML();<br />

var checkProgress = function(xmlObj:XML) {<br />

var bytesLoaded:Number = xmlObj.getBytesLoaded();<br />

var bytesTotal:Number = xmlObj.getBytesTotal();<br />

var percentLoaded:Number = Math.floor((bytesLoaded / bytesTotal ) 100);<br />

trace ("milliseconds elapsed: " + getTimer());<br />

trace ("bytesLoaded: " + bytesLoaded);<br />

XML 683

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

Saved successfully!

Ooh no, something went wrong!