# Embedded video keeps looping

**URL:** https://forum.kirupa.com/t/embedded-video-keeps-looping/324627
**Category:** flash
**Created:** [August 30, 2011, 11:48pm UTC](https://forum.kirupa.com/t/embedded-video-keeps-looping/324627 "2011-08-30T23:48:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Lawrence\_Smith](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@Lawrence\_Smith](https://forum.kirupa.com/u/Lawrence_Smith)
#### Post date: [August 30, 2011, 11:48pm UTC](https://forum.kirupa.com/t/embedded-video-keeps-looping/324627/1 "2011-08-30T23:48:56Z")

</div>

So i have been working on a project, its a digital portfolio. Now I have the Host Movie and and then I have a submovie which is loaded into the Host movie. That all works fine!

Here is my problem… I have embedded a video onto the stage and when I click the exit button to go back to my host the video still plays. Here is my code.

function exit(event:MouseEvent):void {  
var parentObj:Object=this.parent.parent;  
parentObj.closeMovie();  
}

exit\_btn.addEventListener(MouseEvent.CLICK, exit);

var movieLoader:Loader = new Loader();

function addMovie(event:Event):void  
{  
var movieRequest:URLRequest = new URLRequest(“face.swf”);

```
movieLoader.load(movieRequest);

addChild(movieLoader);
movieLoader.x=30;

```

}

face\_btn.addEventListener(MouseEvent.MOUSE\_DOWN,addMovie);

function closeMovie(){  
removeChild(movieLoader);  
}

function addMovie1(event:Event):void  
{  
var movieRequest:URLRequest = new URLRequest(“ipod.swf”);

```
movieLoader.load(movieRequest);

addChild(movieLoader);
movieLoader.x=30;

```

}

ipod\_btn.addEventListener(MouseEvent.MOUSE\_DOWN,addMovie1);

function addMovie2(event:Event):void  
{  
var movieRequest:URLRequest = new URLRequest(“monitor.swf”);

```
movieLoader.load(movieRequest);

addChild(movieLoader);
movieLoader.x=30;

```

}

monitor\_btn.addEventListener(MouseEvent.MOUSE\_DOWN,addMovie2);

function closeMovie1(){  
removeChild(movieLoader);  
}

I also have 3 other objects in the submovie which loads 3 other sub movies.  
Inception!

They work fine, but yet again the video still plays in the background.

Any help would be appreciated.
