I am preloading a SWF file. The main problem is that the preloader doesn’t appear till about 80% of the SWF is loaded. When the percentage appears, it increments as normal.
I have 40 frames with 23 layers, all layers appear at different frames, several levels, masks and the size is 27k. The _root.getBytesTotal() says the size is 45k which is also strange!
I’ve tested my code with other SWF files with 2/3 frames and just an image on the last frame and it works fine.
stop();
this.onEnterFrame = function() {
var LoadedMain = Math.round(_root.getBytesLoaded());
var TotalMain = Math.round(_root.getBytesTotal());
var MainKB = Math.round(TotalMain/1024);
Percent -= (Percent-((LoadedMain/TotalMain)*100))*.25;
Percent = int(Percent);
if( LoadedMain < TotalMain ){
PreloadInfo = "loading "+Percent+"% of "+MainKB+"kb";
stop();
}
if ( LoadedMain > 4 && LoadedMain >= TotalMain){
//reset field
PreloadInfo = "";
delete this.onEnterFrame;
gotoAndPlay(2);
}
}
I won’t post my fla just yet as there might be some conditions… What could be the problem here? It’s driving me nuts.
Thanks