Separate 2 images from xml

Hi all,

I’ve written a code so i can load several images onto my stage with a grid. I wanted it like this so it would be easy to change, add etc because the customer only have to change the xml image path or add and put the picture into the folder. Well this is my code:


public function albumarts(){
						myXMLLoader.load(new URLRequest("albumarts.xml"));
						myXMLLoader.addEventListener(Event.COMPLETE, processXML);
						
							function processXML (e:Event):void{
							var myXML:XML = new XML(e.target.data);
							
							columns = myXML.@COLUMNS;
							my_x = myXML.@XPOSITION;
							my_y = myXML.@YPOSITION;
							my_thumb_width = myXML.@WIDTH;
							my_thumb_height = myXML.@HEIGHT;
							my_images = myXML.IMAGE;
							my_total = my_images.length();
							
							createContainer();
							callThumbs();
							trace("processXML");
							}
							
							
								function createContainer():void{
								container_mc = new MovieClip();
								container_mc.x = my_x;
								container_mc.y = my_y;
								bg.addChild(container_mc);
								container_mc.addEventListener(MouseEvent.CLICK, loadalbuminfo);
								trace("createContainer");
								}
								
								function loadalbuminfo(event:MouseEvent):void{								
									TweenLite.to(container_mc, 3, {x:540, y:-1024});
									TweenLite.to(bg, 3, {x:0, y:-1024});
									
									bg.addEventListener(Event.COMPLETE, tweenfinished);
									container_mc.addEventListener(Event.COMPLETE, tweenfinished2);
									
									function tweenfinished(event:Event):void{
										removeChild(bg)
									}
									
									function tweenfinished2(event:Event):void{
										bg.removeChild(container_mc)
									}
									trace("draw2");
								}
								
									function callThumbs():void{
										for (var i:Number = 0; i < my_total; i++){
										var thumb_url = my_images*.@ALBUM;
										var thumb_loader = new Loader();
										thumb_loader.load(new URLRequest(thumb_url));
										thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
										
										thumb_loader.x = (my_thumb_width+30)*i;
										trace("callthumbs");
										}
									}
									
										function thumbLoaded(e:Event):void{
											var my_thumb:Loader = Loader(e.target.loader);
											container_mc.addChild(my_thumb);
											trace("thumbloaded");
											}
									
					trace("albumarts");
					}

well ive got a problem because, i have a Click event and i want to have a other click event for each image. But now with this click event he is doing the same to both images. How do i define them and give them each their own function.

Greets,

Wouter