-
Movie Clip - load and unload() 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(Pro gressEven t.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLE TE, imageLoaded);
}
loadImage("images/" + image + ".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)
I am struggling to make unload() work. When I use the unload() method - no image appears - but using the trace function the button clicked is recognised.
Hope some one can help.
Looking forward to hearing from you.
Many thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|