# External SWFs don't load all the way?

**URL:** <https://forum.kirupa.com/t/external-swfs-dont-load-all-the-way/312490>\
**Category:** Uncategorized\
**Created:** [August 4, 2010, 7:38pm UTC](https://forum.kirupa.com/t/external-swfs-dont-load-all-the-way/312490 "2010-08-04T19:38:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanawylma](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@lanawylma](https://forum.kirupa.com/u/lanawylma)\
**Post date:** [August 4, 2010, 7:38pm UTC](https://forum.kirupa.com/t/external-swfs-dont-load-all-the-way/312490/1 "2010-08-04T19:38:43Z")

</div>

Hi…

I am working on a an automatic slideshow that’s also clickable with buttons…I got the code to work fine on my sample file, but now that I brought it over to the actual file I need to make a slideshow out of - the external SWFs don’t load all the way! The first default one loads ok - and the rest remain at about 80% Alpha… Does anyone have any idea what may be the prob lem?? Thanks a bunch ahead of time!! below is my code:

//Import classes for easier use  
import fl.transitions.Tween;  
import fl.transitions.TweenEvent;  
import fl.transitions.easing.\*;

//Timer  
var slideDuration:uint = 8000; // or use whatever  
var slideTimer:Timer=new Timer(slideDuration,0);  
slideTimer.addEventListener(TimerEvent.TIMER,autoAdvanceF);  
slideTimer.start();

var btnA:Array = [one\_btn,two\_btn,three\_btn];  
var previousBtn:SimpleButton = one\_btn; // use class type of your buttons

function autoAdvanceF(e:TimerEvent):void{  
nextButtonF(previousBtn).dispatchEvent(new MouseEvent(MouseEvent.CLICK));  
}

function nextButtonF(btn:SimpleButton):SimpleButton{ // use class type of your buttons  
for(var i:uint=0;i\<btnA.length;i++){  
if(btnA\*==btn){  
return btnA[(i+1)%btnA.length];  
}  
}  
return null;  
}

//Load external SWF into main  
var Xpos:Number = 0;  
var Ypos:Number = 0;  
var swf:MovieClip;  
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest(“swfs/one\_btn.swf”);

loader.load(defaultSWF);  
loader.x = Xpos;  
loader.y = Ypos;  
addChild(loader);

//Btns universal function (whenver any button is clicked, the loader will be removed

function btnClick(event:MouseEvent):void {

slideTimer.reset();

slideTimer.start();

```
 previousBtn = SimpleButton(event.currentTarget);

 removeChild(loader);

var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
var myTween:Tween = new Tween(loader, "alpha", None.easeOut, 0, 1, 1, true);
 loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

```

}

/// Button Listerners  
one\_btn.addEventListener(MouseEvent.CLICK,btnClick);  
two\_btn.addEventListener(MouseEvent.CLICK,btnClick);  
three\_btn.addEventListener(MouseEvent.CLICK,btnClick);
