# FLV streaming problems removechild

**URL:** <https://forum.kirupa.com/t/flv-streaming-problems-removechild/281742>\
**Category:** flash\
**Created:** [February 12, 2009, 8:48pm UTC](https://forum.kirupa.com/t/flv-streaming-problems-removechild/281742 "2009-02-12T20:48:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Psyme](https://avatars.discourse-cdn.com/v4/letter/p/8baadc/32.png) [@Psyme](https://forum.kirupa.com/u/Psyme)\
**Post date:** [February 12, 2009, 8:48pm UTC](https://forum.kirupa.com/t/flv-streaming-problems-removechild/281742/1 "2009-02-12T20:48:34Z")

</div>

I give up - I have searched and searched - coded and coded - but just can’t crack this problem - I hope you guys can lift me up on my feets again.

I have a banner in which I have a trailer loaded on mouse over - on mouse out I want to remove the movie - I dont want to ns.close ns.pause and so on - I want to remove it.

I can remove it the first 2 times but when I put my mouse over the third time i get

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.display::DisplayObjectContainer/removeChild()  
at MethodInfo-5()

my code is following.

righteousbtn.addEventListener(MouseEvent.MOUSE\_OVER,MOUSEOVER);

function MOUSEOVER (e:Event):void {  
var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
ns.addEventListener(AsyncErrorEvent.ASYNC\_ERROR, asyncErrorHandler);  
ns.play(“mypathto[.flv](http://flvfiles.dk/trailer/righteous_kill.flv)”);  
function asyncErrorHandler(event:AsyncErrorEvent):void

{  
vid.x = 85;  
vid.y = 0;  
}

var vid:Video = new Video(300,180);  
vid.attachNetStream(ns);  
addChild(vid);  
var tl:MovieClip = this;  
righteousbtn.addEventListener(MouseEvent.MOUSE\_OUT,MOUSEOUT);  
function MOUSEOUT (e:Event): void{  
flash.media.SoundMixer.stopAll()  
tl.removeChild(vid);  
}  
}

can any help me ?

best regards Psyme
