flash xml.getBytesTotal()
- Started
- Last post
- 14 Responses
- UndoUndo
does anyone know of an effective solution to the xml.getBytesTotal() not returning any data until the file is fully loaded? i have tried adding in a content-length header in php which is returning the value but still not working 100%
- PonyBoy0
you could bounce the function off of a couple of frames...
function sits on frame 1... goes to frame 2 which sends it back to 1 and so on until loaded... updating w/each iteration...
... kind of a hack i guess... not even sure if it would work either..
- PonyBoy0
that's apposed to using setInterval of course...
... i take it you're pulling your xml from a php page... meaning it's not 'really' xml... but dynamically created?... there's always a small stall... I think cosmo was working on this at one time...
... cossssmooooo!!!!!! COSSSMOOOOO!!!
I put a call out to cosmo... we'll see if the cow-worshipping anorexic responds...
- UndoUndo0
ha ha thanks - and yeas its dynamically generated xml from php - the file sizes are quite small - but regardless there's no point in having this property if it only returns a value when 100%!!
thanks for yr help PonyBoy
- UndoUndo0
...and im using intervals of 100 milliseconds so updating the func/value shouldnt be a problem
- joyride0
man, flash's xml loading is really disappointing. a few weeks ago i was loading 11000 rows of data and it was really chocking it. IF you've got dynamic xml you might want to have it load 2 files. one is the size, then the xml itself. The first one could be est. total size maybe... that might work... maybe
- UndoUndo0
Ive implemented this work around from MM tech notes
http://livedocs.macromedia.com/f…
but still no love
im still using mx 2004 pro - anyone know if this actually works in 8?
thanks for the tip joyride
- unfittoprint0
never had a problem dealing with php generated xml.
my preloading sequence always triggers the object's getBytesTotal() during loading.
in php you should put your
header("Content-type: text/xml");
print $xml;in the end.
construct your $xml string before.
- UndoUndo0
thanks unfit, my php structure is as per the live docs example but still no joy.
it does suggest to output using two objects, first one with the data from a string the second outputs the headers.
do you get a value even on low file sizes with the files you generate with php??
- cosmo0
cow worshipping? wtf? I don't worship no cows.
I can't find the files, I did this once before.
- UndoUndo0
any idea how cosmo??
- unfittoprint0
that's strange...
I've created a specific class to deal with multiple items loading.
an interval checks each item's getBytesLoaded and getBytesTotal, and as far as I'm concerned, I always get getBytesTotal from each one...
the only problem I have is with CSS: neither getBytesLoaded or getBytesTotal work here. Only a listener checking if the object's content remains undefined or not...
- unfittoprint0
oh
and a lot of those items are php+mysql generated xml...
still, there are a lot of very obscure bugs with Flash...
Recently, and after a thorough search, I discovered that I couldn't use wmode=transparent with Firefox: it would change the user's codepage when dealing with a flash form input fields.
ie. you could not write '@'. just '2'.
wtf?
- UndoUndo0
thanks unfit, Im using a 'generic' preloader fundtion and passing the reference to the xml object - evrything apart from getBytesTotal works - maybe im missing the obvious
- UndoUndo0
I hate it when these things should fly in terms of development and you end up hanging on them for a while. on a saturday too...