Here is the situation I am trying to preload multiple Images simultaneously for a gallery. My initial tests work fine locally using the Flash Simulate Download. The Online version jumps directly to 100. On a Mac the online version works fine and using IE explorer 7 the status says infinity… ? I have preloaded many things before, but never multiple items at the same time. I used a class called ImageController and a class called Gallery Controller. The Gallery controller Creates the ImageControllers for each Image with a for loop. here is the code for that creates the MC for the Image and Loads the Image.
I did have a ImageLoader class that my load progress and initialization was in but to simplify everything until I get it working correctly I set it all up in the ImageController class.
It isn’t very pretty because I am trying to fix the problem so i have been scrambling, adding things taking things out etc… Also the initial “Hello” is in there for me to see when the text box is created.
Any Help would be greatly appreciated.
private function createImgMC() {
IMGmc = root.createEmptyMovieClip("imgmc", root.getNextHighestDepth());
prtxt=root.createTextField("progress",root.getNextHighestDepth(),0,0,70,70);
prtxt.text="HELLO";
imgLoader=new MovieClipLoader();
imgLoader.addListener(this);
imgLoader.loadClip(loc+"/"+filename,IMGmc);
//ImgLoader = new ImageLoader(this, loc+"/"+filename, IMGmc,prtxt);
}
private function onLoadInit(target):Void {
target._visible = false;
target._xscale=scalebase(thw);
target._yscale=target._xscale;
target._visible= true;
}
private function onLoadStart(target){
}
private function onLoadProgress(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
var kbsL = Math.round(bytesLoaded*0.0009765625);
var kbsT = Math.round(bytesTotal*0.0009765625);
var perc= String(Math.round((kbsL/kbsT)*100));
displayprogress(perc);
}
private function displayprogress(percentage){
this.prtxt.text=percentage;
}