# Close button in loaded SWF

**URL:** <https://forum.kirupa.com/t/close-button-in-loaded-swf/277685>\
**Category:** flash\
**Created:** [December 15, 2008, 10:20pm UTC](https://forum.kirupa.com/t/close-button-in-loaded-swf/277685 "2008-12-15T22:20:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [December 15, 2008, 10:20pm UTC](https://forum.kirupa.com/t/close-button-in-loaded-swf/277685/1 "2008-12-15T22:20:43Z")

</div>

I have a main swf that loads another SWF. In that loaded SWF I have a close button that I want to remove the SWF its in.

So I have:

main.swf - I hit a button that loads another swf.  
other.swf - contains a close button to remove itself (itself being other.swf)

I cant manage to get the code to work to remove itself. How would I go about do this? I’ve tried this and its not working:

```auto

private function removeSWF(e:MouseEvent)
{
	p.presenterHolder.removeChildAt(0);
}

```

p = parent and presenterHolder is where other.swf gets loaded into.
