# Multiple Preloaders on One Page

**URL:** <https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221>\
**Category:** Uncategorized\
**Created:** [August 22, 2004, 3:35am UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221 "2004-08-22T03:35:10Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![johnredcorn](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@johnredcorn](https://forum.kirupa.com/u/johnredcorn)\
**Post date:** [August 25, 2004, 5:25pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/21 "2004-08-25T17:25:48Z")

</div>

can u upload the fla… it might help…

if i can geta visual of what i need done it would be easier

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 25, 2004, 5:51pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/22 "2004-08-25T17:51:28Z")

</div>

> [@johnredcorn](#):
>
> can u upload the fla… it might help…
> 
> if i can geta visual of what i need done it would be easier

its too large to upload with all the swfs but the main thing is all made on one frame with nothing on the stage and here is the code on the timeline  
//“btn” is a button  
mA = ;  
mcopyA = ;  
myText.swapDepths(1000);  
myText\_mc.swapDepths(1009);  
movieNum = 6;  
j = 0;  
for (var i = 0; i\<movieNum; i++) {  
clip = [createEmptyMovieClip(“paper”+i, 20-i), “movie”+i+“.swf”];  
mA.push(clip);  
mcopyA.push(clip);  
but = attachMovie(“btn”, “btn”+i, i+100);  
but.\_x = but.\_width+but.\_width_i;  
but.\_y = 300;  
but.myText.text = i;  
but.ivar = i;  
but.onPress = godknows;  
}  
function loader(mc, gw) {  
myText\_mc.mytext.text = mA+" "+mA.length;  
var loading = Math.floor(mc.getBytesLoaded()/1024);  
var total = Math.floor(mc.getBytesTotal()/1024);  
percent = loading/total;  
myText.loading\_txt = Math.floor(percent_100)+" % loaded "+mc.\_name;  
if (loading\>=total && loading\>1) {  
showUp(gw);  
mc.isLoaded = true;  
endLoading(mc);  
}  
}  
function endloading(k) {  
mA.splice(0, 1);  
clearinterval(myInterval);  
if (mA.length\>0) {  
loadMovie(mA[j][1], mA[j][0]);  
myInterval = setInterval(loader, 20, mA[j][0]);  
} else {  
myText.loading\_txt = “DONE”;  
trace(“finished”);  
trace(mA.length);  
finished = true;  
}  
}  
function showUp(Klip) {  
//for (var i = 0; i\<mcopyA.length; i++) {  
//mcopyA\*[0].\_visible = false;  
//}  
mcopyA[Klip][0].\_visible = true;  
mcopyA[Klip][0].swapDepths(90);  
mcopyA[Klip][0].play();  
}  
function godknows() {  
clearInterval(myinterval);  
p = this.ivar;  
if (mA.length\>0 && mA.length\<=mcopyA.length && mcopyA[p][0].isLoaded != true) {  
for (var k = 0; k\<mA.length; k++) {  
if (mA[k] == mcopyA[p]) {  
myvar = mA.splice(k, 1);  
mA = myvar.concat(mA);  
mytext.isloaded = mA[0];  
}  
}  
loadMovie(mA[0][1], mA[0][0]);  
myInterval = setInterval(loader, 20, mA[0][0], p);  
delete myvar  
} else if (mA.length\>0 && mA.length\<=mcopyA.length && mcopyA[p][0].isLoaded != false) {  
showup(p);  
trace(mcopyA[p][0].isLoaded);  
myInterval = setInterval(loader, 20, mcopyA[p][0], p);  
} else {  
trace(mcopyA[p][0].isLoaded != false);  
showup(this.ivar);  
}  
}  
loadMovie(mA[j][1], mA[j][0]);  
myInterval = setInterval(loader, 20, mA[j][0]);

---

<div class="post-metadata">

**Author:** ![johnredcorn](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@johnredcorn](https://forum.kirupa.com/u/johnredcorn)\
**Post date:** [August 25, 2004, 6:06pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/23 "2004-08-25T18:06:54Z")

</div>

wow confusing but ill give it a try

---

<div class="post-metadata">

**Author:** ![Gupps](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Gupps](https://forum.kirupa.com/u/Gupps)\
**Post date:** [August 25, 2004, 9:24pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/24 "2004-08-25T21:24:26Z")

</div>

hi stringy, what if you want to load certain swfs into the main swf. say you want A.swf to load first before B.swf and than once B.swf loaded to load C.swf etc. I be using variables.

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 25, 2004, 9:55pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/25 "2004-08-25T21:55:22Z")

</div>

> [@Gupps](#):
>
> hi stringy, what if you want to load certain swfs into the main swf. say you want A.swf to load first before B.swf and than once B.swf loaded to load C.swf etc. I be using variables.

you can just do it on different frames if you want

egfirstframe  
stop();  
createEmptyMovieClip(“paper”, 1);  
paper.\_x = 50;  
paper.\_y = 50;  
assessLoad = function (clip) {  
var kbLoaded = Math.floor(clip.getBytesLoaded()/1024);  
var kbTotal = Math.floor(clip.getBytesTotal()/1024);  
percent = kbLoaded/kbTotal;  
percent\_txt.text = Math.floor(percent\*100)+“%”;  
if ((kbLoaded == kbTotal) && kbTotal\>1) {  
percent\_txt.text = “”;  
// do whatever  
clearInterval(myInterval);  
\_root.play();  
}  
};  
loadMovie(“movie1.swf”, paper);  
myInterval = setInterval(assessload, 50, paper);

second frame

stop();  
createEmptyMovieClip(“paper1”, 2);  
paper1.\_x = 250;  
paper1.\_y = 250;  
loadMovie(“movie2.swf”, paper1);  
myInterval = setInterval(assessload, 50, paper1);

third frame

stop();  
createEmptyMovieClip(“paper2”, 3);  
paper2.\_x = 450;  
paper2.\_y = 150;  
loadMovie(“movie3.swf”, paper2);  
myInterval = setInterval(assessload, 50, paper2);

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 25, 2004, 10:28pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/26 "2004-08-25T22:28:26Z")

</div>

just made it for you  
[http://www.gifsrus.com/testfile/fadeinout/multiloader.swf](http://www.gifsrus.com/testfile/fadeinout/multiloader.swf)

you`ll have to upload to the web to see with movie1.swf etc in the same folder

---

<div class="post-metadata">

**Author:** ![patricktheking](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@patricktheking](https://forum.kirupa.com/u/patricktheking)\
**Post date:** [August 25, 2004, 10:29pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/27 "2004-08-25T22:29:36Z")

</div>

k

---

<div class="post-metadata">

**Author:** ![patricktheking](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@patricktheking](https://forum.kirupa.com/u/patricktheking)\
**Post date:** [August 25, 2004, 10:31pm UTC](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221/28 "2004-08-25T22:31:22Z")

</div>

thanks for all ur help… u truly helped me here and i appreciate it

[Previous page](https://forum.kirupa.com/t/multiple-preloaders-on-one-page/120221.md?page=1)
