Toggle button

I have 5 button with ID = but1, but2, but3, but4, but5

I want to loop the buttons and create a click event to toggle the alpha of the buttons.

but the following code doesn’t work when looping each of the button IDs.

how can I loop each button and set a Key event toggle?



functALL = new Array ( but1, but2, but3, but4, but5 );

for ( i=0; i < functALL.length; i++){
    functALL*.onRelease = function (){
        if (functALL*._alpha = 40 ){
            functALL*._alpha = 100;
        } else {
            functALL*._alpha = 40;
        }
    }
}