
XML.getBytesTotal() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
930
|
ActionScript Language Reference
// Usage:
// Create an XML object.
doc = new XML();
// Assign an onLoad() callback.
doc.onLoad = function (success) {
// If the load was successful...
if (success) {
// ...process the new XML.
trace("done loading!");
} else {
// ...otherwise, perform failure operations and
// cancel the preload interval (REQUIRED!).
trace("load failed");
this.clearLoadCheck();
}
}
// Assign an onBytesLoaded() callback. This is where each XML document
// can decide what to do with the preload information.
doc.onBytesLoaded = function (bytesLoaded, bytesTotal,
kbLoaded, kbTotal, percentLoaded) {
trace("Loading: " + kbLoaded + " of " + kbTotal);
trace(percentLoaded + " percent complete.");
}
// Preload the XML file.
doc.preload("http://www.yoursite.org/datafiles/someInfo.xml");
See Also
setInterval(), XML.getBytesTotal(), XML.load(), XML.onLoad(), XML.sendAndLoad()
XML.getBytesTotal() Method
the physical disk size of an external XML file, in bytes
Flash 6
xmlDoc.getBytesTotal()
Returns
An integer representing the size of the XML file, in bytes. Divide by 1024 to convert bytes
to kilobytes (KB).
Description
The getBytesTotal() method tells us the byte size of an external file being loaded into xmlDoc
via XML.load() or XML.sendAndLoad(). The specified ...