# External SWF's with individual pre-loaders

**URL:** https://forum.kirupa.com/t/external-swfs-with-individual-pre-loaders/129993
**Category:** Uncategorized
**Created:** [November 30, 2004, 4:26pm UTC](https://forum.kirupa.com/t/external-swfs-with-individual-pre-loaders/129993 "2004-11-30T16:26:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mikeymoves](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mikeymoves](https://forum.kirupa.com/u/mikeymoves)
#### Post date: [November 30, 2004, 4:26pm UTC](https://forum.kirupa.com/t/external-swfs-with-individual-pre-loaders/129993/1 "2004-11-30T16:26:31Z")

</div>

Hi,

This is my first post, so be gentle! I am a relative newbie to flash. I am having a problem with loading external movies. I can call the movies into my main “base” layer swf into the blank movie clip that I selected as the target. That works fine. The problem arises when I add a pre-loader progress bar to the movies that load externally. Maybe I am putting the code in the wrong spot, or maybe I am just an idiot! It is driving me mad.

Here is the code I am assigning to frame 1 of the swf that is being called into the main movie.:

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

I assigned this code to the movie clip of the preloader on the stage. I labeled frame 1 of the ext swf “percent” and labeled frame 2 “start.” What ends up happening is that there is a loop that never ends!

I took this tutorial from Kirupa and it works on the Kirupa FLA file, so I might have messed something up in the transfer.

Thanks!
