Use the same function for many buttons
Hi,
I want to use the same function for each of my buttons instances. I will need to have about 90 buttons that will use the same function and each function will need to send parameter to another SWF.
Here is the basic code. How would you make it in the way to use the same function for the two buttons? Thank you.
buttonF1.addEventListener(MouseEvent.CLICK,btnpressed1);
buttonF2.addEventListener(MouseEvent.CLICK,btnpressed2);
function btnpressed1(e:MouseEvent){
buttonF1.removeEventListener(MouseEvent.CLICK,btnpressed1);
buttonF1.enabled = false;
buttonF1.visible = false;
}
function btnpressed2(e:MouseEvent){
buttonF2.removeEventListener(MouseEvent.CLICK,btnpressed2);
buttonF2.enabled = false;
buttonF2.visible = false;
}