# Preloader when loading dynamic content in swf

**URL:** https://forum.kirupa.com/t/preloader-when-loading-dynamic-content-in-swf/84601
**Category:** flash
**Created:** [March 29, 2005, 1:41am UTC](https://forum.kirupa.com/t/preloader-when-loading-dynamic-content-in-swf/84601 "2005-03-29T01:41:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![renikm](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@renikm](https://forum.kirupa.com/u/renikm)
#### Post date: [March 29, 2005, 1:41am UTC](https://forum.kirupa.com/t/preloader-when-loading-dynamic-content-in-swf/84601/1 "2005-03-29T01:41:21Z")

</div>

Hello all,

So I’ve made a preloader before as below, on the first frame.  
Works like a charm.

```auto
onClipEvent(enterFrame) {

	mctotal = _root.getBytesTotal();
	mcloaded = _root.getBytesLoaded();

	mcpercent = Math.round((mcloaded / mctotal) * 100);

	//when switching to frame based animation, use gotoAndStop()

	pl_an_mc.gotoAndStop(mcpercent);
	progress_mc._xscale = mcpercent;
	progress_text.text = mcpercent + " %";
	
	if (mcpercent == 100) {
		_root.play();

	}
}

```

However, now i want to load some images(to be used as backgrounds) before the site appears. Below is an example of the code.

```auto
case 0 :
	this.blur.loadMovie("themes/01blur.jpg");
	this.blur2.loadMovie("themes/01blur.jpg");
	this.theme.loadMovie("themes/01base.jpg");
	current_color = "0x99FF99";
	break;

```

Can I still use the same preloader, or do I have to make one for each of the images I load.  
I would appreciate anyone pointing me in the right direction. Thanks!
