Get rid of the nested function, avoid it at all times (IMO).
var img_mcl:MovieClipLoader;
function onLoadInit(t:MovieClip) {
main.hideMc(t);
}
function loadImage(imagePath, targetMc) {
var container_mc:MovieClip = targetMc.img_mc;
var loading_mc:MovieClip = targetMc.loading_mc;
img_mcl.loadClip(imagePath,container_mc);
}
img_mcl = new MovieClipLoader();
img_mcl.addListener(this);
----- Original Message -----
From: "Marcelo Wolfgang" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Tuesday, February 12, 2008 7:18 PM
Subject: [Flashcoders] Multiple moviecliploaders
Hi all,
I'm using the movieClipLoader class to load 6 different images
'simultaneous' but since it's the same object that got called every
time the .onLoadInit on happens for the last call, does anyone has a
clue how I can make this:
function displayThumbs() {
for (i = 0; i < modelsArray.length; i++) {
var path:String = "http://www.bottero.net/2008/images/modelos/s/ref"
+ modelsArray[i] + "s.png";
loadImage(path,thumb_mc);
}
}
function loadImage(imagePath, targetMc) {
var container_mc:MovieClip = targetMc.img_mc;
var loading_mc:MovieClip = targetMc.loading_mc;
mclListener.onLoadInit = function() {
main.hideMc(loading_mc);
};
img_mcl.addListener(mclListener);
img_mcl.loadClip(imagePath,container_mc);
}
var mclListener:Object = new Object();
var img_mcl:MovieClipLoader = new MovieClipLoader();
work for multiple loadings at the same time ?
TIA
Marcelo Wolfgang
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders