var buttons:Array = [button_ok, button_go, button_reset]; function my_func() { trace ("щелкнута " + this); }; for (i in buttons) { buttons[i].onPress = my_func; }