# Loading external FLV-s in embedded video

**URL:** https://forum.kirupa.com/t/loading-external-flv-s-in-embedded-video/320006
**Category:** flash
**Created:** [March 11, 2011, 12:01am UTC](https://forum.kirupa.com/t/loading-external-flv-s-in-embedded-video/320006 "2011-03-11T00:01:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sax586](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@sax586](https://forum.kirupa.com/u/sax586)
#### Post date: [March 11, 2011, 12:01am UTC](https://forum.kirupa.com/t/loading-external-flv-s-in-embedded-video/320006/1 "2011-03-11T00:01:54Z")

</div>

:puzzle:In Flash MX 2004 Pro. I have embedded the video in which needs to load several external FLV files. These are the problems.

1. How do I stop the video and it removed (with the shutdown sound)

2. How do I upload another FLV file in the same embedded video (I have separate buttons for each FLV file) and also remove previous FLV file

This is the code that I use:

my\_nc = new NetConnection();  
my\_nc.connect(null);  
my\_ns = new NetStream(my\_nc);  
my\_video.attachVideo(my\_ns);  
my\_ns.play(“my\_movie.flv”);  
my\_ns.onStatus = function(info) {  
for (var i in info){  
trace(i+" = "+info\*);  
}  
if(info.code==“NetStream.Buffer.Empty” && waitingForEmpty==true){  
//display a play button because the video is done  
replay\_btn.\_visible=true;  
}  
if(info.code==“NetStream.Play.Stop”){  
waitingForEmpty=true;  
}  
};  
waitingForEmpty=false;  
replay\_btn.\_visible=false;  
replay\_btn.onPress=function(){  
replay\_btn.\_visible=false;  
waitingForEmpty=false;  
my\_ns.play(“my\_movie.flv”);  
}

Thanks
