Grabbing Part of an Instance Name and Using as a Variable

Hello again Gurus,

I have 36 buttons on my stage that are named [thumbBut0, thumbBut1, thumbBut2,…, thumbBut35]. Each button is a thumbnail image. I want to have it so that when the user clicks on a given thumbnail, the full-sized image corresponding to the thumbnail gets loaded and viewed…yada, yada, yada… So, if the user clicks on thumbBut25, the 25th image gets viewed…

My question: is there some cool way that I could avoid writing 36 different (although they would be similar) “_level0.thumbButXX.onRelease = function()…” type things for each of the 36 buttons. In other words, when the user clicks the instance “thumbBut25” something grabs the “25” part out of the instance name, converts it to an integer, and passes it on to a function that loads up the image that corresponds to “25”?

My brain just can’t get a grip on how one would do this. Any help would be appreciated, as always.