hi.
i'm using the MovieClipLoader class to load a few swfs that are
defined in an array a la:
var totalWeight = 41079759; // total weight in bytes (3.9MB)
var currentWeight = 0;
var mainArray:Array = new Array( { path: "movie1.swf", id:
"movie1_mc", depth: 1 },
{ path:
"movie2.swf", id: "movie2_mc", depth: 2 },
{ path:
"movie3.swf", id: "movie3_mc", depth: 3 });
for( i:Number=0; i<mainArray.length; i++ )
{
_root.loadClip( mainArray[i].path, this.createEmptyMovieClip(
mainArray[i].id, mainSwfArray[i].depth ) );
}
what i want to do is read how much is loaded of the total weight ( the
sum of all swfs ) and target my preloader for every 10%. i assume the
best place to read the loaded bytes is in the onLoadProgress handler
for MCL, a la:
mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes )
{
currentWeight += loadedBytes;
var currentPercentage = Math.floor( ( loadedBytes / totalWeight ) * 100
);
}
the 3 swfs weight approximately 3.9 megabytes but when i trace out the
value of "currentWeight", i get this value:
407,970,619.....but this equals 389 megabytes, not 3.9. what am i
doing wrong here?
thanks for any tips. -- matt.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders