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 {