Want Value not referenece

Basicly I have 26 butttons, one for each letter of the alphabet, I am using a for loop to give them all a listener, so that the all react the same way, but are destinguished seperatly by the order they were created.

but when tracing out k, no matter what button is pressed it always returns ‘26’

for(var k=0;k<=25;k++)
{


    SpellingButtons[k].addEventListener(MouseEvent.CLICK,function(){
             
    trace("k ="+k);     

I also tried creating it as a function with parameters

SpellingButtons[k].addEventListener(MouseEvent.CLICK,function(k)

But this just seemed to produce errors when used the ‘addEventListener’

any ideas?