# External preloader

**URL:** <https://forum.kirupa.com/t/external-preloader/141822>\
**Category:** Uncategorized\
**Created:** [March 23, 2005, 1:45pm UTC](https://forum.kirupa.com/t/external-preloader/141822 "2005-03-23T13:45:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RysChwith](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RysChwith](https://forum.kirupa.com/u/RysChwith)\
**Post date:** [March 23, 2005, 1:45pm UTC](https://forum.kirupa.com/t/external-preloader/141822/1 "2005-03-23T13:45:35Z")

</div>

[font=verdana, arial][size=2]I’m attempting to preload an external SWF. All the tutorials make this look very easy, but I can’t seem to get it to function on mine. The code I’m using is as follows:[size=1][font=verdana,arial]

```auto
[/font][/size][/size][/font]stop();[indent] 
if( started != true ) {
	var started:Boolean = true;
	this.createEmptyMovieClip( "holder", 10 );
	holder.loadMovieNum( "benefacts3.swf", 0 );
}

var total = holder.getBytesTotal();
var loaded = holder.getBytesLoaded();

var progress = loaded / total;
trace( "Total: " + total + ", Loaded: " + loaded + ", Progress: " + progress );
var percent = Math.round( progress * 100 );

if( percent < 100 ) {
	fill._x = 85.2 + ( 173 * progress );
	gotoAndPlay( "start" );
} else {
	gotoAndPlay( "go" );
}[size=2][font=verdana, arial]

```

[/font][/size][/indent][font=verdana, arial][size=2]The setup is a three-frame scene. The first, labeled “start” has nothing in it except the graphics for the preloading. The second, “load,” contains the script you see above. The third, “go,” contains the AS “nextScene();”.

The trace statement shows me that loaded and total are both coming in at zero bytes, so it blows right past the preloader. I know the holder movieclip is being created successfully, both because the target movie does load and because it does show up when I hit Debug \> Show Objects. I’ve tried putting it in as \_level0.holder, but that hasn’t produced any better results. Using \_level0.holder.\_level0 _does_ produce a different number (somewhere around 1200 bytes), but such a small one that the effect is the same.

Anyone see anything that I’m doing wrong?

Rys[/size][/font]
