User Guide
724 ActionScript classes
If no DOCTYPE declaration was encountered during a parse operation, the XML.docTypeDecl
property is set to
undefined. The XML.toString() method outputs the contents of
XML.docTypeDecl immediately after the XML declaration stored in XML.xmlDecl, and
before any other text in the XML object. If
XML.docTypeDecl is undefined, no DOCTYPE
declaration is output.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example uses the
XML.docTypeDecl property to set the DOCTYPE declaration
for an XML object:
my_xml.docTypeDecl = "<!DOCTYPE greeting SYSTEM \"hello.dtd\">";
See also
xmlDecl (XML.xmlDecl property)
getBytesLoaded (XML.getBytesLoaded method)
public getBytesLoaded() : Number
Returns the number of bytes loaded (streamed) for the XML document. You can compare the
value of
getBytesLoaded() with the value of getBytesTotal() to determine what
percentage of an XML document has loaded.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
Number - An integer that indicates the number of bytes loaded.
Example
The following example shows how to use the
XML.getBytesLoaded() method with the
XML.getBytesTotal() method to trace the progress of an XML.load() command. You must
replace the URL parameter of the
XML.load() command so that the parameter refers to a
valid XML file using HTTP. If you attempt to use this example to load a local file that resides
on your hard disk, this example will not work properly because in test movie mode Flash
Player loads local files in their entirety.
// create a new XML document
var doc:XML = new XML();
var checkProgress = function(xmlObj:XML) {
var bytesLoaded:Number = xmlObj.getBytesLoaded();
var bytesTotal:Number = xmlObj.getBytesTotal();