# Loading an external swf file after FLV plays?

**URL:** <https://forum.kirupa.com/t/loading-an-external-swf-file-after-flv-plays/261087>\
**Category:** flash\
**Created:** [May 22, 2008, 11:20pm UTC](https://forum.kirupa.com/t/loading-an-external-swf-file-after-flv-plays/261087 "2008-05-22T23:20:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott1969](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@scott1969](https://forum.kirupa.com/u/scott1969)\
**Post date:** [May 22, 2008, 11:20pm UTC](https://forum.kirupa.com/t/loading-an-external-swf-file-after-flv-plays/261087/1 "2008-05-22T23:20:36Z")

</div>

I have an animated intro and menu as a swf. When you click on a chapter it loads a external swf with a flv in it. when the movie ends I want the video to unload and the menu section of the intro swf to load.

What is the best way to accomplish this?

**Here is the code for the intro swf ( i only have the introduction bttn active for testing):**

```auto

stop();

var PhysTestRequest:URLRequest = new URLRequest("trainIntro.swf");
var PhysTestLoader:Loader = new Loader();

intro_btn.addEventListener(MouseEvent.MOUSE_DOWN, newvid);

function newvid(event:MouseEvent):void {
    trace("you clicked me");
    PhysTestLoader.load(PhysTestRequest);
    addChild(PhysTestLoader);
}
intro_btn.buttonMode=true;

```

**This is the code for the swf file containg the flv:**

import fl.video.\*;  
import fl.controls.ProgressBarMode;

// Set Variables  
var flvControl = display;  
var flvSource = “Introduction.flv”;

// Create event handler functions to control the progressbar  
function progressHandler(event:VideoProgressEvent):void {  
var bl = Math.round(event.bytesLoaded/1000);  
var bt = Math.round(event.bytesTotal/1000);

```
// Update progress...
pb.setProgress(bl,bt);

```

}

function readyHandler(event:VideoEvent):void {  
// Remove progressbar when we start playing…  
removeChild(pb);  
}

Any help would be greatly appreciated.  
Scott

// Set progress bar state  
pb.mode = ProgressBarMode.MANUAL;  
pb.indeterminate = false;

// Add listeners and load the video  
flvControl.addEventListener(VideoProgressEvent.PROGRESS, progressHandler);  
flvControl.addEventListener(VideoEvent.READY, readyHandler);  
flvControl.source = flvSource;

buttonMode = false;
