Make sure you're loading a file from a web server, not locally.  Local 
files will be loaded in one shot so getBytesTotal will not be what you 
expect.

In my experience getBytesTotal will not be ready in the same frame, or 
possibly even the next, but whenever Flash is able to get the size of the 
file from the server.

The slow part of loading a large local XML file is the parsing of the XML 
by Flash, not the loading of the file itself.

"all other caluculations had to stop until the XML was loaded."
That's true for local files: XML, SWF, etc.  Not true when loading from a 
web server.


Derek Vadneau


> Yes I also tried this with the same results.
>
> Merrill, Jason wrote:
>
>>>>var pctLoaded:Number = Math.floor(my_xml.getBytesLoaded() /
>>>>my_xml.getBytesTotal() * 100);
>>>>
>>
>>Does that really work?  I know you said you got it from the help docs
>>and all, but I always thought the Flash player, when it came to loading
>>XML, ran single threaded in the sense that all other caluculations had
>>to stop until the XML was loaded.  I ask because with the code you
>>posted, I tried it on a 2mb XML file and pctLoaded traces NaN, and
>>my_xml.getBytesLoaded traces 0 the entire time the file is loading.


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to