I Have three answer choices for a question. (codes below)
if 1 button has been clicked, the other 2 buttons will be disabled.
But .. apparently, the same button can be clicked more than once. How do i do to stop that ? and only allow 1 click.
//CHOICE A
function ona1Click(evt:MouseEvent):void {
Why not just removeListener() to the button clicked? An alternative is button.mouseEnabled = false - if you re-use the same buttons then just, change to true on reset.
I would create a function to Disable all buttons then call that function from your clicked function.
function disableButtons():void{
aa1.removeEventListener(MouseEvent.CLICK, ona1Click);
bb1.removeEventListener(MouseEvent.CLICK, onb1Click);
cc1.removeEventListener(MouseEvent.CLICK, onc1Click);
//or as steven FN said, you can use the .mouseEnabled method
}
funtion onb1Click(e:MouseEvent):void{
//all of your other code
disableButtons();
}