# Unload SWF error

**URL:** <https://forum.kirupa.com/t/unload-swf-error/323226>\
**Category:** flash\
**Created:** [June 21, 2011, 6:57pm UTC](https://forum.kirupa.com/t/unload-swf-error/323226 "2011-06-21T18:57:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itscloudy614](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@itscloudy614](https://forum.kirupa.com/u/itscloudy614)\
**Post date:** [June 21, 2011, 6:57pm UTC](https://forum.kirupa.com/t/unload-swf-error/323226/1 "2011-06-21T18:57:16Z")

</div>

I’m writing an Android app and I have a loader that brings in an external swf. I want to create an event so that when the back button is pressed it unloads the swf. But I can’s seem to get it to work.

Any ideas?

```auto
private function jumptest (event:TouchEvent):void{
            var infoloader:Loader = new Loader();
            var infoURL:URLRequest=new URLRequest("MapInspectorGW.swf");
            infoloader.contentLoaderInfo.addEventListener(Event.COMPLETE, infoDone);
            infoloader.load(infoURL);
            
            NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, infoBack);
        }
        

    private function infoDone (loadEvent:Event)
    {
        addChild(loadEvent.currentTarget.content);
    }
    
    private function infoBack (event:KeyboardEvent):void
    {
		if (event.keyCode == Keyboard.BACK)
		{
       		infoloader.unload();
		}
        
    }

```
