# External .SWF preloader problem sends .swf into a chaotic frenzy!

**URL:** <https://forum.kirupa.com/t/external-swf-preloader-problem-sends-swf-into-a-chaotic-frenzy/244079>\
**Category:** flash\
**Created:** [November 14, 2007, 4:27am UTC](https://forum.kirupa.com/t/external-swf-preloader-problem-sends-swf-into-a-chaotic-frenzy/244079 "2007-11-14T04:27:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjurriaans](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sjurriaans](https://forum.kirupa.com/u/sjurriaans)\
**Post date:** [November 14, 2007, 4:27am UTC](https://forum.kirupa.com/t/external-swf-preloader-problem-sends-swf-into-a-chaotic-frenzy/244079/1 "2007-11-14T04:27:15Z")

</div>

I am loading external .swf’s into one main .swf and am using the following code to preload the individual .swf’s:

stop();  
loadingBar.\_xscale = 1;  
var loadingCall:Number = setInterval(preloadSite, 50);  
function preloadSite():Void {  
var siteLoaded:Number = getBytesLoaded();  
var siteTotal:Number = getBytesTotal();  
var percentage:Number = Math.round(siteLoaded/siteTotal\*100);  
loadingBar.\_xscale = percentage;  
percentDisplay.text = percentage + “%”;  
if (siteLoaded \>= siteTotal) {  
clearInterval(loadingCall);  
play();  
}  
}

This is in the first frame of the external .swf timeline.

This works fine when testing the whole site offline (no html embedding). I put the site up and if you interrupt the loader by clicking a new menu item (that also needs to load an external .swf) before the initial item finishes loading it sends all the external .swf’s into a frenzy! Here is the site:

[http://www.vanderhurdstudio.com](http://www.vanderhurdstudio.com)

Please help!
