# Loader.unload help - Hiding an image

**URL:** <https://forum.kirupa.com/t/loader-unload-help-hiding-an-image/267664>\
**Category:** Uncategorized\
**Created:** [August 4, 2008, 4:29pm UTC](https://forum.kirupa.com/t/loader-unload-help-hiding-an-image/267664 "2008-08-04T16:29:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnnymac](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@Johnnymac](https://forum.kirupa.com/u/Johnnymac)\
**Post date:** [August 4, 2008, 4:29pm UTC](https://forum.kirupa.com/t/loader-unload-help-hiding-an-image/267664/1 "2008-08-04T16:29:47Z")

</div>

Right…

I have the following code below that loads an image.

I have added a button and want the image to be hidden when the button is clicked… can anyone help… loader.unload seems to be the suggested method but I can’t seem to get it to work… helpppppppppp.

Thanks, John

var imageLoader:Loader;

function loadImage(url:String):void {

// Set properties on my Loader object  
imageLoader = new Loader();  
imageLoader.load(new URLRequest(url));  
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);  
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

}  
loadImage(“dr4\_b.jpg”);

function imageLoaded(e:Event):void {

// Load Image  
imageArea.addChild(imageLoader);

}

function imageLoading(e:ProgressEvent):void {
