# Unloading / closing External SWF with button

**URL:** <https://forum.kirupa.com/t/unloading-closing-external-swf-with-button/271261>\
**Category:** Uncategorized\
**Created:** [September 20, 2008, 1:06pm UTC](https://forum.kirupa.com/t/unloading-closing-external-swf-with-button/271261 "2008-09-20T13:06:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roxdedy](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@roxdedy](https://forum.kirupa.com/u/roxdedy)\
**Post date:** [September 20, 2008, 1:06pm UTC](https://forum.kirupa.com/t/unloading-closing-external-swf-with-button/271261/1 "2008-09-20T13:06:45Z")

</div>

I would be glad If You could help me with that problem, there are many post about it but it is not solve clearly.

I have got 2 files \*\*main.swf, \*\ ***picture.swf**

My aim is to load picture.swf in main.swf and than close it using button that is place in picture.swf

AS code in **main.swf** looks like:

var imageRequest:URLRequest = new URLRequest (“picture.swf”);  
var imageLoader:Loader = new Loader();  
imageLoader.x = 352;  
imageLoader.y = 144;  
addChild(imageLoader);

function addClick(event:MouseEvent):void  
{  
imageLoader.load(imageRequest);  
}  
button1.addEventListener(MouseEvent.CLICK, addClick);

In **picture.swf** i create a button close\_btn and here i have no idea what to do next …  
i wonder to use lightbox but there are problems with it as well so I AM BARGING YOU FOR A HELP GUYS 😕
