Hi,
At least here, the addListener is missing from your code. But so is the loadClip()...
code:
mcl.addListener(mclL)
For example, this works just fine:
code:
for (var i = 1; i <= 5; i++)
{
var mc = this.createEmptyMovieClip("mc" + i, i);
mc._x = 50 * i;
var mcl:MovieClipLoader = this["mcl" + i];
mcl = new MovieClipLoader();
var mclL:Object = this["mclL" + i];
mclL = new Object();
mclL.onLoadProgress = function(target, loaded, total)
{
trace("onProgress " + target);
};
mclL.onLoadInit = function(target)
{
trace("onLoadInit " + target);
};
mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", mc);
mcl.addListener(mclL)
}
But it has a problem. I'd create the objects like this instead:
code:
var mcl:MovieClipLoader = this["mcl" + i] = new MovieClipLoader();
var mclL:Object = this["mclL" + i] = new Object();
Because something like
code:
var mcl:MovieClipLoader = this["mcl" + i];
is useless, as this["mcl" + i] is undefined.
code:
var mcl:MovieClipLoader = this["mcl" + i];
mcl = new MovieClipLoader();
trace(this["mcl" + i]); // undefined
while
code:
var mcl:MovieClipLoader = this["mcl" + i] = new MovieClipLoader();
trace(this["mcl" + i]); // [object Object]