# External SWF Loader Question

**URL:** <https://forum.kirupa.com/t/external-swf-loader-question/205151>\
**Category:** flash\
**Created:** [October 26, 2006, 4:29pm UTC](https://forum.kirupa.com/t/external-swf-loader-question/205151 "2006-10-26T16:29:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![incarnate](https://avatars.discourse-cdn.com/v4/letter/i/96bed5/32.png) [@incarnate](https://forum.kirupa.com/u/incarnate)\
**Post date:** [October 26, 2006, 4:29pm UTC](https://forum.kirupa.com/t/external-swf-loader-question/205151/1 "2006-10-26T16:29:15Z")

</div>

Hey there.

Using Lee’s External Loader tutorial, I tried to make one for a portfolio site.  
There are two problems with my output:

1. when i put a background colour for the swf1 and swf2, they don’t seem to be there. the data is, but not the background colour.

2. how come when i run it on a webpage in html, the selected swf1 won’t load up, but, when i load it as a SWF on it’s own, it loads up?

```auto

import mx.transitions.Tween;
import mx.transitions.easing.*;

stop();
logoSlide = mx.transitions.easing.Strong.easeOut;

//MAIN TWEENS
var logoTween = new mx.transitions.Tween(bodyBG, "_xscale", logoSlide, 0, 100.0, 0.5, true);

logoTween.onMotionStopped = function()
{
	var logoTween2 = new mx.transitions.Tween(bodyBG, "_height", logoSlide, 0, 516.0, 0.6, true);
	
	logoTween2.onMotionStopped = function()
	{
		var logoTween3 = new mx.transitions.Tween(extLoader, "_alpha", logoSlide, 0, 100, 0.5, true);
		
		logoTween3.onMotionStopped = extLoaderFunc;
	}
}

//EXTERNAL LOADER
function extLoaderFunc()
{
	//trace("anyone here?");
	var mcl:MovieClipLoader = new MovieClipLoader();
	var mclL:Object = new Object();
	
	mclL.onLoadProgress = function(target,loaded,total)
	{
		//trace("onLoad");
		//updates percentage of loaded content
		//returns values of loaded, total.
		extLoader.percent.text = Math.round((loaded/total) * 100) + "%";
		
		var amount:Number = Math.round((loaded/total) * 100);
		extLoader.extLoaderBar._xscale = amount;
		
		/*if(amount == 100)
		{
			logo = mx.transitions.easing.Strong.easeOut;
			var logoAlphaFinal = new mx.transitions.Tween(extLoader.percent, "_alpha", logo, 100, 0, 3.95, true);
		}*/
	}
	
	mclL.onLoadInit = function()
	{
		//when 100% has been reached, the loader becomes invisible
		//empty the percent text string to nothing
		logo = mx.transitions.easing.Strong.easeOut;
		var thePercent = new mx.transitions.Tween(extLoader.percent, "_alpha", logo, 100, 0, 0.8, true);
		
		thePercent.onMotionStopped = closeUp;
		
		function closeUp()
		{
			extLoader._visible = false;
			extLoader.percent.text = "";
		}
	}
	
	//will receive events from the above objects/functions
	mcl.addListener(mclL);
	
	//loads clip when you start SWF
	mcl.loadClip("swf1.swf",holder);
	
	//BUTTONS
	home_btn.onRelease = function()
	{
		//will make the loader visible and load the clip for swf1
		extLoader._visible = true;
		mcl.loadClip("swf1.swf",holder);
	}
	b2.onRelease = function()
	{
		//will make the loader visible and load the clip for swf2
		extLoader._visible = true;
		mcl.loadClip("swf2.swf",holder);
	}
}//end extLoader()

```

This is not the entire code for the project, but this is the most important part so it’s all you need to know.

The link is at: [http://www.tsaconas.com/temp2/](http://www.tsaconas.com/temp2/)  
The SWF file is at: [http://www.tsaconas.com/temp2/flash/body.swf](http://www.tsaconas.com/temp2/flash/body.swf)  
The SWF file it is calling is: [http://www.tsaconas.com/temp2/flash/swf1.swf](http://www.tsaconas.com/temp2/flash/swf1.swf)

Cheers.
