# Preloading external swf

**URL:** https://forum.kirupa.com/t/preloading-external-swf/180835
**Category:** Uncategorized
**Created:** [March 3, 2006, 6:59pm UTC](https://forum.kirupa.com/t/preloading-external-swf/180835 "2006-03-03T18:59:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tedc](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tedc](https://forum.kirupa.com/u/tedc)
#### Post date: [March 3, 2006, 6:59pm UTC](https://forum.kirupa.com/t/preloading-external-swf/180835/1 "2006-03-03T18:59:35Z")

</div>

Hi there, Im trying to preload an external swf. I am using the following code:

Frame 1 of preloader mc:

```auto
frloaded = _root.getBytesLoaded() + _level4.getBytesLoaded();
frtotal = _root.getBytesTotal() + _level4.getBytesTotal();
if (frloaded < frtotal) {
	tellTarget ("_root") {
		stop();
	}
}

```

Frame 2 of preloader mc:

```auto
frloaded = _root.getBytesLoaded() + _level4.getBytesLoaded();
frtotal = _root.getBytesTotal() + _level4.getBytesTotal();
if (frloaded < frtotal) {
	tellTarget ("_root") {
		stop();
	}
}

```

Frame 3 of preloader mc:

```auto
gotoAndPlay(2);

```

So yeah, basically I want the initial preloader to display loading progress for not only the root, but also the loaded mc on \_level4.

However, sometimes there is some problems. If I have my preloader mc on the next frame after using loadMovieNum(“home.swf”,4); then it doesnt load home.swf but if I put the preloader mc some 20 frames later, it works fine. However, if home.swf is already loaded (for example if after loading everything I just refresh the page) then it doesnt load. It’s like it needs some time to understand that there is an swf being loaded or something… How can I work around this?

Thanks!
