# Main movie loads before preloader is finished

**URL:** <https://forum.kirupa.com/t/main-movie-loads-before-preloader-is-finished/90489>\
**Category:** flash\
**Created:** [May 18, 2005, 6:36am UTC](https://forum.kirupa.com/t/main-movie-loads-before-preloader-is-finished/90489 "2005-05-18T06:36:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sushifiend3000](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Sushifiend3000](https://forum.kirupa.com/u/Sushifiend3000)\
**Post date:** [May 18, 2005, 6:36am UTC](https://forum.kirupa.com/t/main-movie-loads-before-preloader-is-finished/90489/1 "2005-05-18T06:36:28Z")

</div>

Hi, first time posting.

I’ve created a preloader for this site:

[http://pennington.cc/ad/AD\_main.html](http://pennington.cc/ad/AD_main.html) (rough version for client preview)

which basically consists of what you see when the movie first loads, except instead of the row of thumbnails at the bottom there’s a progress bar. The preloader AS is here, stored in frame 1:

```auto

progress_mc._xscale = 0;
this.createEmptyMovieClip("holder_mc", 0);
holder_mc._visible = false;
holder_mc.loadMovie("AD_main.swf");

progress_mc.onEnterFrame = function(){
	var loaded = holder_mc.getBytesLoaded();
	var total = holder_mc.getBytesTotal();
	if (total > 15) {
		progress_mc._xscale = Math.round(loaded / (total / 100));
		if (loaded >= total) {
			holder_mc._visible = true;
			holder_mc.swapDepths(999);
			this.removeMovieClip();
		}
	}
}

```

My problem is that, at 10% loaded, AD\_main.swf appears in place of the preloader. I tried pointing the preloader to a jpeg image and it works fine; it waits until it’s 100% loaded before displaying it. I added

```auto
holder_mc._visible = false;

```

but it didn’t help.

Then I removed all but the background and the progress bar of the preloader swf (remember the layouts of the preloader and frame 1 of AD\_main.swf are identical) and with the bandwidth profiler set at 56K I could see the different elements of AD\_main.swf loading on top of the preloader, despite the Actionscript. I’m stumped. Somebody please tell me why this isn’t working. TIA

Jerome

If you have a dial-up connection you can see the preloader at [http://pennington.cc/ad/AD\_preload.html](http://pennington.cc/ad/AD_preload.html)
