# Pre-loading one external clip while another plays

**URL:** <https://forum.kirupa.com/t/pre-loading-one-external-clip-while-another-plays/56907>\
**Category:** Uncategorized\
**Created:** [July 8, 2004, 6:36pm UTC](https://forum.kirupa.com/t/pre-loading-one-external-clip-while-another-plays/56907 "2004-07-08T18:36:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [July 9, 2004, 8:53pm UTC](https://forum.kirupa.com/t/pre-loading-one-external-clip-while-another-plays/56907/4 "2004-07-09T20:53:45Z")

</div>

Ok, try this. It works for my swf’s, you just need to download the preloader class com.qlod.LoaderClass. I have the code if you need it. Just put the names of your clips in swf\_array. Also, two clips are always running at the same time, so if that’s not ok (i.e. your sounds might be screwy) you may need to add something to the if statement to make the unneeded one stop. This isn’t the best code but it seems to work for me seemlessly.

swf\_array = [“part1.swf”,“part2.swf”,“part1.swf”,“part2.swf”,“part1.swf”,“part2.swf”,“part1.swf”,“part2.swf”,“part1.swf”,“part2.swf”,“part1.swf”,“part2.swf”];  
counter = 0;  
var tc = this.createEmptyMovieClip(“TopClip”,3);  
var bc = this.createEmptyMovieClip(“BottomClip”,2);  
myLoader = new com.qlod.LoaderClass();  
var tcflag = false;  
var bcflag = false;  
this.onEnterFrame = function()  
{  
if(counter == 0)  
{  
myLoader.load(tc,swf\_array[counter]);  
counter++;  
myLoader.load(bc,swf\_array[counter]);  
counter++;  
}  
else if(tcflag)  
{  
tcflag=false;  
tc.swapDepths(2);  
tc.unloadMovie();  
bc.gotoAndPlay(1);  
myLoader.load(tc,swf\_array[counter]);  
counter++

}  
else if(bcflag )  
{  
bcflag=false;  
bc.swapDepths(2);  
bc.unloadMovie();  
tc.gotoAndPlay(1);  
myLoader.load(bc,swf\_array[counter]);  
counter++  
}  
else if(tc.\_visible && tc.\_totalFrames == tc.\_currentFrame)  
{  
tcflag = true;  
}  
else if(bc.\_visible && bc.\_totalFrames == bc.\_currentFrame)  
{  
bcflag = true;  
}  
}

---

_[View the full topic](https://forum.kirupa.com/t/pre-loading-one-external-clip-while-another-plays/56907)._
