Question about Mini Games Menu

Hello Everyone,I’m happy to be here in this forum.

my question:
I’m trying to build a mini games Menu that have 3 difficulty levels with each having 5 buttons.
There are also 3 languages button.
All of them are sorted in arrays.

Each minigame has it’s own movie clip ,there are 15 minigames.

The issue is that I can’t recognize each button individually when I use the mouse click event,and also need to add a specific MovieClip(the minigame) as as a child after a specific button was pressed.

The event.target.name doesn’t work because of the random name giving of each instance in the array.

Help would be appreciated as better coding suggestions.

The class I use is called GameMenu.as and is a child of Main.as class.

 
package
{
 
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    public class GameMenu extends MovieClip
    {
    //var for button array,and button num counter,and button offset   
    //var for button name array and label array
    var numberOfButtonsVert:int = 2;
    var numberOfButtonsHorz:int = 3;
 
    public var easyButton_arr:Array = new Array(numberOfButtonsVert);
    public var medButton_arr:Array = new Array(numberOfButtonsVert);
 
    public var langButton_arr:Array = new Array(numberOfButtonsHorz);
    public var buttonOffsetY:int = 40;
    public var buttonOffsetX:int = 120;
 
        public function GameMenu() {
 
            arrangeVerticalButtons(easyButton_arr,EasyGameButton, 590, 130);
            arrangeVerticalButtons(medButton_arr, MedGameButton, 370, 130);
 
            //set language button
            //1.add to screen and set button place 2.set button name
            arrangeHorizontalButtons(langButton_arr, LangButton,40, 500);
            setHorizontalButtonName(langButton_arr, "lang");
 
            //set game Language
            setLanguage("Hebrew");
 
 
            addEventListener(MouseEvent.CLICK, gotoActivity);
        }
 
        public function gotoActivity(e:MouseEvent):void {
 
        }
 
 
public function arrangeVerticalButtons(buttonArray:Array,button:Class,startPositionX:int,startPositionY:int):void {
 
            for(var i:int=0; i < numberOfButtonsVert; i++) {
                buttonArray* = new button();
                startPositionY+= buttonOffsetY;
                buttonArray*.x = startPositionX;
                buttonArray*.y = startPositionY;
                addChild(buttonArray*);
            }
        }
 
             public function arrangeHorizontalButtons(buttonArray:Array,button:Class,startPositionX:int,startPositionY:int):void {
 
            for(var i:int=0; i < numberOfButtonsHorz; i++) {
                buttonArray* = new button();
                buttonArray*.x = startPositionX;
                buttonArray*.y = startPositionY;
                startPositionX+= buttonOffsetX;
                addChild(buttonArray*);
            }
        }
 
        public function setHorizontalButtonName(buttonArray:Array, name:String):void {
            for (var i:int = 0; i < numberOfButtonsHorz; i++) {
                buttonArray*.gotoAndStop(name + [i+1]);
            }
        }
 
        public function setVerticalButtonName(buttonArray:Array, name:String):void {
            for (var i:int = 0; i < numberOfButtonsVert; i++) {
                buttonArray*.gotoAndStop(name + [i+1]);
            }
        }
 
        public function setLanguage(currentLanguage:String):void {
            switch(currentLanguage) {
                case "Hebrew":
                setVerticalButtonName(easyButton_arr, "heb_btn");
                break;
 
                case "English":
                setVerticalButtonName(easyButton_arr, "eng_btn");
                break;
            }
        }
 
        public function numOfChildrenIndex(m:MovieClip):void {
 
            for (var i:Number = 0; i < m.numChildren;i++){
             trace("num of Layer "+i+" in "+m.name+" name Of MC "+m.getChildAt(i).name);
            }
        }
    }
 
}