# Including external swf file with preloader in main swf file

**URL:** <https://forum.kirupa.com/t/including-external-swf-file-with-preloader-in-main-swf-file/258177>\
**Category:** flash\
**Created:** [April 21, 2008, 5:37pm UTC](https://forum.kirupa.com/t/including-external-swf-file-with-preloader-in-main-swf-file/258177 "2008-04-21T17:37:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave19](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@dave19](https://forum.kirupa.com/u/dave19)\
**Post date:** [April 21, 2008, 5:37pm UTC](https://forum.kirupa.com/t/including-external-swf-file-with-preloader-in-main-swf-file/258177/1 "2008-04-21T17:37:54Z")

</div>

I’m creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file

loadMovie(“deepbartesting.swf”, maincontent);  
this.onEnterFrame=function(){  
if(movieClipName.\_currentframe==5){  
movieClipName.stop();  
delete this.onEnterFrame;  
}  
}

my problem is that this file is around 3mb. I created a preloader with it, with the code

onClipEvent (load) {  
total = \_root.getBytesTotal();  
} onClipEvent (enterFrame) {  
loaded = \_root.getBytesLoaded();  
percent = int(loaded/total\*100);  
percen101 = “”+percent+"%";  
gotoAndStop(percent);  
if (loaded == total) {  
\_root.gotoAndPlay(2);  
;  
;  
}  
}

the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?

Thanks for your help
