Is there a way to make a preloader base on onEnterFrame function and then delete it after the content has finished loading? I’m asking this because I used this method for some thumbnail preloader movie but the thing is that when I end up with 30 generated thumbnails they eat up processor power because each thumnail’s onEnterFrame function is running endlessly…
The code I used is this one and it’s placed inside the tumbnail clip where the preloader components are:
thumb_loader.thumbLbar._xscale = 0;
loader_text._visible=false;
thumb_loader._visible=false;
this.onEnterFrame = function() {
filesize = thumbHolder.getBytesTotal();
loaded = thumbHolder.getBytesLoaded();
thumb_loader._visible = true;
loader_text._visible=true;
if (loaded != filesize) {
loader_text.loadT.text=Math.round(100*loaded/filesize);
thumb_loader._visible=true;
thumb_loader.thumbLbar._xscale = 100*loaded/filesize;
} else {
loader_text._visible=false;
thumb_loader._visible=false;
}
}
Now, when I want the onEnterFrame action to stop (whe teh content has finished loading) I add the following line inside the [COLOR=DarkRed]else[/COLOR] tag:
delete this.onEnterFrame;
but I know it’s not right because the preloader doesn’t show anymore…it displays for a split second at the begining of the download and then it disapears and at the end the content is displayed…
Does anyone know why that is?
Appreciate any help I can get…