Skip to main content
Participant
July 24, 2006
Answered

getBytesLoaded() gets bigger than total size report

  • July 24, 2006
  • 1 reply
  • 288 views
I'm trying to program a preloader that uses fixed byte values for measuring how far the loading has proceeded.
To determine the sizes of single frames, I sum up the values in the size report.
My problem: when downloading (live as well as in the Flash environment w/simulated download) the getBytesLoaded() func gives me bigger numbers than the size report (both for _root) and so throws off the preloader. How can that be? What am I missing? If I trace() getBytesLoaded() when everything is loaded, that number is about 20% off (higher) compared to the size report.
Thanks a lot!
al
This topic has been closed for replies.
Correct answer Newsgroup_User
Export the movie with compression turned off .. then you'll know the number
of bytes for each frame. Then use those figures in your script and test
again (as changing the script may change the figures). Then, when it all
seems to work, turn compression back on and it should work just fine (only
difference is that the whole thing will be quicker, which is good)
--
Jeckyl


1 reply

Inspiring
July 24, 2006
Its probably a compressed SWF file.

Anyway .. it doesn't matter

you take percentage getBytesLoaded of getBytesTotal and all will be fine.

Ignore the size report when it comes to loading your file.
--
Jecykl


al13Author
Participant
July 25, 2006
Jeckyl,
Thanks for the answer.
The problem is that my FLA is built i a way that every keyframe in the _root timeline is a "page". Every of these pages weighs about 100-200k. They are in a reasonable order, so that the ones that get chosen most often or earlier in a session are at the beginning.
Now I'd like the user to be able to go to the 2nd page (keyframe #2) as soon as it's loaded, even though keyframe #10 (total: 1Mb) hasn't loaded yet - do you see the problem? To get the load percentage I'd have to know how much was loaded when the new page was called and how much has to be loaded. Or is there a possible use of getBytesTotal() I'm not seeing?

Thanks!
al