
Welcome Guest
|
#1
|
|||
|
|||
|
preload dynamic images and percentages
hi
i'm trying to load a set of dynamic images, which is fine but i'm trying to work out the total size of all the files for a preloader, is there anyway i can get the whole size of the files loading or do i have to do each one individually, i've done it to load them individually, but i'm trying to do it in one go here's the code i've been trying Code:
onClipEvent(load){
imageArray = new Array("001", "002", "003", "004");
path2Images = "folio_images/folio/ccp/";
this.createEmptyMovieClip("holder",1);
for(n=0;n<imageArray.length;n++){
this.holder.createEmptyMovieClip("holder" + n, n);
imagesLoaded = path2Images + imageArray[n] +".jpg";
this.holder["holder" + n].loadMovie(imagesLoaded);
this.holder["holder" + n]._x = n*40;
this.holder["holder" + n]._y = n*40;
}
_root.attachMovie( "loadingAnim", "loader", 2000);
_root.loader._x = 100;
_root.loader._y = 100;
}
onClipEvent(enterFrame){
for(i=0;i<imageArray.length;i++){
amountLoaded += this.holder["holder" + i].getBytesLoaded();
totalLoaded += this.holder["holder" + i].getBytesTotal();
}
_root.percent=int((amountLoaded/totalLoaded)*100);
if(_root.percent == 100){
_root.loader.removeMovieClip();
}
}regards andy |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|



