F8: ONE preloader for all clips using MovieClipLoader

Hello folks,
I’m using a MovieClipLoader to load multiple images into multiple movieclips, and I would like to have a preloader bar that loads them all at the same time, rather than one after the other. I’ve seen some that dynamically create empty movie clips on the fly, but I need to load my images into specifically named and placed movieclips.

As far as I can tell, my script should update a global variable for total bytes loaded so far(totalLoaded) and another for total bytes to be loaded (totalToLoad). I am able to get that second variable accurately, but not the first–the slower the connection is (with Simulate Download), the closer it gets to 100, but never quite makes it. (With local testing speed it only reaches around 60%!)

Maybe this has something to do with a difference between getProgress and onLoadProgress?


this.createEmptyMovieClip("dash_holder", -10);
this.createEmptyMovieClip("bar_holder", 20);
dash_holder._x = bar_holder._x = 0;
dash_holder._y = bar_holder._y = 0;
var images:Array = ["dash.jpg", "bar.png"];
var destinations:Array = [_root.dash_holder, _root.bar_holder];
var totals:Array = [0, 0];
_global.totalLoaded = 0;
_global.totalToLoad = 0;
var myLoader = new MovieClipLoader();
myLoader.onLoadStart = function(targetMC) {
    var loadProgress = myLoader.getProgress(targetMC);
    _global.totalToLoad += loadProgress.bytesTotal;
};
myLoader.onLoadProgress = function(targetMC, lBytes, tBytes) {
    for (i=0; i<images.length; i++) {
        if (destinations*.loadedBytes != undefined) {
            totals* = destinations*.loadedBytes;
        }
    }
    _global.totalLoaded = totals[0] + totals[1]; //Not sure how to find the sum of all totals[] values without typing them out this way?
    targetMC.loadedBytes = lBytes;
    trace(_global.totalLoaded+" out of "+_global.totalToLoad+" loaded");
};
for (i=0; i<images.length; i++) {
    myLoader.loadClip(images*, destinations*);
}

Any help is appreciated! :wasted: