# Preloader for external swfs

**URL:** <https://forum.kirupa.com/t/preloader-for-external-swfs/221198>\
**Category:** flash\
**Created:** [April 2, 2007, 12:54pm UTC](https://forum.kirupa.com/t/preloader-for-external-swfs/221198 "2007-04-02T12:54:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![welsh](https://avatars.discourse-cdn.com/v4/letter/w/5fc32e/32.png) [@welsh](https://forum.kirupa.com/u/welsh)\
**Post date:** [April 2, 2007, 12:54pm UTC](https://forum.kirupa.com/t/preloader-for-external-swfs/221198/1 "2007-04-02T12:54:51Z")

</div>

hi everyone,

i was wondering if anyone could help me. I have a site that opens its pages by loading swfs into an empty movie clip on the stage. My problem is that the swfs are biggish, and take time to load. I have preloaders in them, but they dont work when used with an swf being loaded into the main page. It just shows a blank for a while then goes ahead and plays the timeline with things half loaded, missing images etc.

I used the same preloader on the main page and it works fine. The code is:  
(frame 1)

percent = int(\_root.getBytesLoaded() / \_root.getBytesTotal() \* 100);  
percentLoad = percent + “% Loaded”;  
bar.\_xscale = \_root.getBytesLoaded() / \_root.getBytesTotal() \* 100;  
bar.\_x = 3.245000E+002 + bar.\_width / 2;  
if (\_root.getBytesLoaded() \>= \_root.getBytesTotal())  
{  
gotoAndPlay(6);  
}

in the second frame it gets sent back to frame one and frame 6 sends a movie loaded message and plays frame 7 onwards:

(frame 2) gotoAndPlay(1);

(frame 6) percentLoad = “Movie Loaded”;

stop ();  
gotoAndPlay(7);

Am I missing something very obvious? I’m teaching myself flash so there might be some basic things I’m missing. Can anyone help?

welsh
