hi guys…i am having trouble with a custom moviecliploader class i am trying to make…so far, i can load only the first two images , and then it stops…any thought on how to get the whole array (imageNames) to load. My class is like this:
class ELoader {
var mclPre:MovieClipLoader;
var oP:Object = new Object();
var imageNames:Array;
var place:MovieClip;
function ELoader(imageNames:Array, place:MovieClip) {
//loadImages(imageNames, count, place);
loadImages(imageNames, 0, place);
}
function loadImages(imageNames, count, place) {
var count:Number;
var mclPre:MovieClipLoader = new MovieClipLoader();
mclPre.addListener(oP);
var imageIs:String = imageNames[count];
var holder:MovieClip = place.createEmptyMovieClip("im"+count, count);
//holder._alpha = 0;
oP.onLoadProgress = function(clip:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var perc:Number = Math.round((bytesLoaded/bytesTotal)*100);
if (perc>=100) {
clip._alpha = 0;
}
};
oP.onLoadInit = function(mcClip:MovieClip) {
trace(mcClip)
mcClip._alpha = 100;
};
oP.onLoadComplete = function(mcClip) {
again(imageNames, count, place);
};
mclPre.loadClip("images/"+imageIs, holder);
}
function again(imageNames, count, place) {
trace(count);
if (count<=imageNames.length) {
count++;
loadImages(imageNames, count, place);
}
if (count>imageNames.length) {
trace("done");
}
}
}
and in my main movie i have :
var here:MovieClip = this.createEmptyMovieClip("here", this.getNextHighestDepth());
var images:Array = ["0.JPG", "1.JPG", "2.JPG", "3.JPG", "4.JPG", "5.JPG", "6.JPG", "7.JPG"];
var eL:ELoader = new ELoader(images, here);
and yes, the image names/path are correct