hey guys -
this code works to load my images from my xml into my holder movie clips. it’s successfully preloading the images as well.
however, the preloaders are displaying some sort of overall preload percent, or rather, whichever preload percent is closest to being done. then it blinks and switches to the next closest to being loaded (i’m guessing…)
i have 7 MC’s on my stage. each has an inner MC that gets the loaded images from the XML. each of the 7 MC’s also has dynamic text to receive the loaded percentage from the MoveClipLoader.
how do i get the loaders to show only it’s individual load time? do i need to create a new MovieClipLoader for each holder?
i’m sure there’s a more dynamic way of doing this.
import flash.filters.DropShadowFilter;
var numOfItems:Number;
var home:MovieClip = this;
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target, loaded, total) {
for (i=0; i<numOfItems; i++) {
var t = home["holder"+i];
t.load_txt.text = Math.round((loaded/total)*100)+"%";
}
};
mclL.onLoadInit = function() {
for (i=0; i<numOfItems; i++) {
var t = home["holder"+i];
t.load_txt.text = "";
}
};
mcl.addListener(mclL);
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
var nodes:Array = this.firstChild.childNodes;
numOfItems = nodes.length;
for (i=0; i<numOfItems; i++) {
var t = home["holder"+i];
t.filters = [new DropShadowFilter(5, 45, 0x000000, 1, 10, 10, .55, 3)];
mcl.loadClip(nodes*.attributes.thumb,t.inner);
}
};
xml.load("tops.xml");
thanks for your help!