Find the number of this image

Ok so i have a gallery of images, 4 galleries actually. I have thumbnails that pop up for each gallery. I want to find out how to detect which thumbnail is being selected so i can load the appropriate image.


	var picNum:Number
	
	picLoad.load(new URLRequest(myXML.Gallery[galNum].Image[picNum].@picURL));
	stage.addChild(picLoad);

galNum changes my gallery, thats not a problem at all.
However, I want to know how to assign the value to picNum so that it tells what picture is being selected.

event.target.data maybe?

can someone steer me in the right direction?