I'm certain some of the real coders on this list can optimize this or
point out its faults but it worked for me on a few projects:
// iterate thru a list of items for loading
len = items.length
_count = len + 1;
for (var i:Number = 0; i < len; i++) {
loadItem(items[i]);
}
function loadItem(swf) {
// do the MCL thing and in your onLoadProgress function
// get the current amount loaded and calculate the difference
loaded between each time
// onLoadProgress fires (assuming you are using MovieClipLoader).
Then call a
// function like below which adds that difference to the amounts
of all items loaded
// which results in the total percentage.
}
_loadedtotal = 0;
function updatePercentage(per:Number) {
// then calculate that number as a percentage of 5 items (_count):
_loadedtotal += per;
var allpercentage:Number = Math.floor(_loadedtotal/(_count * 100)
* 100);
}
On Jun 15, 2007, at 9:53 AM, Helios Pregioni Bayma wrote:
Yeah, but the client wants to show % of all images togheter.
Like if I have 5 images (20kb, 40kb, 10kb, 10kb, 20kb)
and swf has loaded 10kb of the first image
the loader shows 10% loaded, cause it´s 10kb of 100kb of all images
not showing any other information.
If there´s no way to do it, I can say it to the client and change,
use the
way you said.
If there´s a way, let me know.
Thanks!
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com