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)";
}
}
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)";
}
}