# Basic removeChild problem

**URL:** https://forum.kirupa.com/t/basic-removechild-problem/255165
**Category:** Uncategorized
**Created:** [March 19, 2008, 6:11pm UTC](https://forum.kirupa.com/t/basic-removechild-problem/255165 "2008-03-19T18:11:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Rundevo](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@Rundevo](https://forum.kirupa.com/u/Rundevo)
#### Post date: [March 19, 2008, 6:11pm UTC](https://forum.kirupa.com/t/basic-removechild-problem/255165/1 "2008-03-19T18:11:56Z")

</div>

There are quite afew threads that cover this topic, but I couldnt make any of them to work.

What I want to do is to write an if statement to check if an external swf has been loaded to the stage, and if it has, I want to remove it and go to a framelable, else, jsut go to a framelabel.

I thought this was easy, but I keep getting errors saying that the swf I´m checking for cant be found.

Can someone help me with the code?

function on\_click(event:MouseEvent):void {  
if (product1.swf) {  
removeChild(product1.swf);  
MovieClip(root).gotoAndStop(“home”);  
}  
else {  
MovieClip(root).gotoAndStop(“home”);  
}

Thanks in advance  
/rundevo
