# How to have an External SWF play automatically

**URL:** https://forum.kirupa.com/t/how-to-have-an-external-swf-play-automatically/275876
**Category:** flash
**Created:** [November 19, 2008, 6:09pm UTC](https://forum.kirupa.com/t/how-to-have-an-external-swf-play-automatically/275876 "2008-11-19T18:09:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chrisribar](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@chrisribar](https://forum.kirupa.com/u/chrisribar)
#### Post date: [November 19, 2008, 6:09pm UTC](https://forum.kirupa.com/t/how-to-have-an-external-swf-play-automatically/275876/1 "2008-11-19T18:09:01Z")

</div>

attached is the action script and swf (zipped)…

the .fla is too big to attach. ☹

this is the part of the script that activates the movie clip on a click:

// EXTERNAL VIDEO 1  
buttonLR.loadSWF\_btn.onPress = function() {  
if (currentFocus == mainTimeline.SWFHolder\_mc) {  
trace('SWF already focused return ')  
return;  
};  
mainTimeline.center\_mc.loader\_mc.\_visible = true;  
var loader:MovieClipLoader = new MovieClipLoader();  
var loaderL:Object = new Object();

```
loaderL.onLoadProgress = function(target:MovieClip, loaded:Number, total:Number):Void {
	var percent:Number = Math.ceil((loaded / total)*100);
	mainTimeline.center_mc.loader_mc.loaderBar_mc._xscale = percent;
	trace('percent '+percent);
}
loaderL.onLoadInit = function(target:MovieClip) {
	setBgSize(target);
oldFocus._visible = false;
	var c:Tween=new Tween(target, "_alpha", Regular.easeOut, 0, 100,0.5,true);
	var d:Tween=new Tween(target, "_visible", Regular.easeOut, 100, 100,0.5,true);
	trace('load completed');
	mainTimeline.center_mc.loader_mc._visible = false;
	currentFocus = target;
	oldFocus = target;
}
loaderL.onLoadStart = function(target:MovieClip):Void {
	target._alpha = 0;
}
loader.addListener(loaderL);
loader.loadClip('external.swf', SWFHolder_mc);

```

}

the button in the lower right corner of the swf activate the external swfs through the buttonLR.loadSWF\_btn.onPress = function()…

I would like to have this swf load and then play when the site starts loading…can anyone help? thanks!
