Button changes another button's colour

Hello,
I want to have a group of 3 buttons. All of these buttons will be red until one of them in clicked. When one is clicked, it will turn green. If it is clicked again, it will turn red.
However, if another button is clicked, that button will turn green and the original button will turn back to red.
So, only one button will be green at any one time, and the rest will be red.
Is this possible to do?

I have no idea how to start with this.

Thanks.
:slight_smile:

edit: i have tried


btn1.addEventListener(MouseEvent.CLICK, btnClicked);
btn2.addEventListener(MouseEvent.CLICK, btnClicked);
btn3.addEventListener(MouseEvent.CLICK, btnClicked);

function btnClicked(evt:Event):void {
    btn1.gotoAndStop("red");
    btn2.gotoAndStop("red");
    btn3.gotoAndStop("red");

    evt.target.gotoAndStop("green");
    
}

however, I cannot click the same button to turn it red; only another button. Therefore I cannot turn all my buttons red- one always has to be green!