# HELP:Using Events to Load External SWF

**URL:** <https://forum.kirupa.com/t/help-using-events-to-load-external-swf/307231>\
**Category:** flash\
**Created:** [March 31, 2010, 2:18am UTC](https://forum.kirupa.com/t/help-using-events-to-load-external-swf/307231 "2010-03-31T02:18:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdense51](https://avatars.discourse-cdn.com/v4/letter/w/45deac/32.png) [@wdense51](https://forum.kirupa.com/u/wdense51)\
**Post date:** [March 31, 2010, 2:18am UTC](https://forum.kirupa.com/t/help-using-events-to-load-external-swf/307231/1 "2010-03-31T02:18:12Z")

</div>

Hi All

I’ve only been using actionscript 3 for about 2 weeks, so my lack of understanding is really showing.

I’m trying to use events to get an external SWF to load when another external SWF with flv content finishes playing.

This is my first experience with events so I’ve probably approached it from completely the wrong angle.

Any help would be appreciated…

Here is the code from the main file:

```auto

var Xpos:Number=110;
var Ypos:Number=110;
var swf_MC:MovieClip = new MovieClip();
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest("arch_reel.swf");

addChild (swf_MC);
swf_MC.x=Xpos
swf_MC.y=Ypos

loader.load(defaultSWF);
swf_MC.addChild(loader);
//Btns Universal Function
function btnClick(event:MouseEvent):void{
SoundMixer.stopAll();
    swf_MC.removeChild(loader);
    
    var newSWFRequest:URLRequest = new URLRequest("motion.swf");
    loader.load(newSWFRequest);
    swf_MC.addChild(loader);
    

}
function returnSWF(event:Event):void{
    swf_MC.removeChild(loader);
    loader.load(defaultSWF);
    swf_MC.addChild(loader);
}
//Btn Listeners
motion.addEventListener(MouseEvent.CLICK,btnClick);

swf_MC.addEventListener(swf_MC.motionClip.Event.COMPLETE,swf_MC.motionClip.eventClip, returnSWF);
    

```

And from the external file:

```auto
import fl.video.FLVPlayback;

import fl.video.VideoEvent;

 

motionClip.playPauseButton = player;
motionClip.seekBar = seeker;

 

motionClip.addEventListener(VideoEvent.COMPLETE, goNext);

 

function goNext(e:VideoEvent):void {

nextFrame();

}

stop();

function eventClip (e:Event):void{ 

}
    

```
