onClick, set variable, no function

Hey everyone. been a trillion years since on the kirupa forums. I’m working with XML and setting up a portfolio gallery. I basically want a thumbnail to be clicked and have an image opening, but i want the instance name of a button that is clicked to be stored in a variable that can be used when calling the images from the XML. this is what i have at the moment.

So i’m just trying to get the number that is in the instance name of btn2, and use that number 2 to reference the ID # in the xml file. i know there are easier ways to do this, but i didnt want to write new functions for all the numerous thumnbails on the site.


btn1. addEventListener(MouseEvent.Click, _onBtnClick);

function _onBtnClick( e:MouseEvent ):void {
    var clickedBtn = event.target.name;
}

also the thumbnails are not being loaded through the XML, would it be easier to load the larger images without functuions for each thumb, if i had the thums being referenced through the XML?