PDA

View Full Version : Different file sizes in Report and getTotalBytes?


RoGuE_StreaK
08-11-2005, 12:10 PM
A quick question, my file is 265KB, and the filesize report says it's 273730 bytes, but my preloader, using getTotalBytes, says 355.7KB!

Any ideas why it's over-reporting the file size? I'm ashamed that the file had to be so big in the first place (I think good flash should be more like 30K!), it was unavoidable, but the preloader makes it look even worse!

Of course I could remove any references to file size and just rely on percentages, but I'd like to figure out why this is happening!?

my preloader code, attached to loadBar_mc:onClipEvent(enterFrame)
{var totalBytes = _root.getBytesTotal();
var loadedBytes = _root.getBytesLoaded();
var totalKiloBytes = [(Math.round((totalBytes/1024)*100)/100)];
var loadedKiloBytes = [(Math.round((loadedBytes/1024)*100)/100)];
percentLoaded = int((loadedKiloBytes/totalKiloBytes)*100);
if(loadedBytes == totalBytes)
{_root.gotoAndPlay(2);
_root.percent_txt.text = "movie loaded";
}
else
{_root.gotoAndStop(1);
this._xscale = percentLoaded;
_root.percent_txt.text = "loading "+percentLoaded+" % (" + loadedKiloBytes + " / " + totalKiloBytes +"KB)";
}
}

RoGuE_StreaK
08-15-2005, 04:18 AM
Anyone?

oldnewbie
08-15-2005, 04:35 AM
Compression feature of the movie with MX and up...

RoGuE_StreaK
08-15-2005, 09:24 AM
But the actual download would still only be the filesize, right? Not the uncompressed movie size?

So I'd have to approximate the compression ratio and work this into my preloader to give a more accurate picture of how much actual download size is happening, correct?

eg., say filesize is 270K, uncompressed size is 360K, so the figure I should be displaying is .75 x getBytesLoaded?

oldnewbie
08-15-2005, 12:53 PM
IMHO, the more a preloader displays info, the more it's a "turn away" factor...
I'm even against a pre-defined border on a simple loadbar, because it visually helps the user to better somewhat estimate the preloading time...

Remember that I'm visiting your site for it's content not for it's preloader however sophisticated and precise it might be...