# Multiply preloading targeting

**URL:** <https://forum.kirupa.com/t/multiply-preloading-targeting/62108>\
**Category:** Uncategorized\
**Created:** [August 25, 2004, 2:24am UTC](https://forum.kirupa.com/t/multiply-preloading-targeting/62108 "2004-08-25T02:24:35Z")\
**Posts on this page:** 3\
**Page:** 1

<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, 2:24am UTC](https://forum.kirupa.com/t/multiply-preloading-targeting/62108/1 "2004-08-25T02:24:35Z")

</div>

hi, everybody. Need help in preloading multiple swf into a main swf. The catch is to have for example Apple.swf to finish preloading first before banana.swf and than orange.swf to load once both apple and banana swf is loaded.

Hope this make sense.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 25, 2004, 3:22am UTC](https://forum.kirupa.com/t/multiply-preloading-targeting/62108/2 "2004-08-25T03:22:00Z")

</div>

at the beginning of each movie you are loading you could use:

loadedbytes = getBytesLoaded();  
totalbytes = getBytesTotal();  
if (loadedbytes == totalbytes) {  
\_root.gotoAndPlay(\_currentFrame+1);  
//where \_root is your parent movie doing the loading  
} else {  
\_root.gotoAndPlay(\_currentFrame-1);  
//where \_root is your parent movie doing the loading  
}

//example loading code//  
then in frame 2:  
loadMovieNum(“apple.swf”, \_level);

then in frame 4:  
loadMovieNum(“banana.swf”, \_level);

then in frame 6:  
loadMovieNum(“orange.swf”, \_level);

I am using similar code to loading an infinite number of movies after eachother, but I’m using arrays and junk to work all that out. The loadedbytes code works a treat if you put it at the beginning of each movie loading.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 25, 2004, 4:04am UTC](https://forum.kirupa.com/t/multiply-preloading-targeting/62108/3 "2004-08-25T04:04:49Z")

</div>

thanks newflavour. I’ll try that out. but i was hoping that there was another way to do it.
