Movie Clip - load image
Hi,
I have a function when a button is clicked an image is loaded into the movie clip:
var imageLoader:Loader;
function loadImage(url:String):void {
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage("images/" + pic + ".jpg");
function imageLoaded(e:Event):void {
movieclip_mc.addChild(imageLoader);
}
Is there a way I can remove the previous image from the movie clip before loading the next one? - so replacing the image with the new one when clicked. (the movie clip starts of empty)
Hope some one can help.
Looking forward to hearing from you.
Many thanks