I am creating a Noughts and Crosses game with radio buttons, 9 buttons and 9 dynamic text boxes. The code below is on a button that when a player clicks on that button it is suppose to display whichever radio button is selected and the problem is that it displays 0 even when X is selected. See the comments in the code for more information.
on(release) {
// checking radio button X is selected
if (X_rb.getValue()==true) {
// displaying X in a text box
lbl1 = "X";
// disabling button after been clicked on
Button1.enabled = false;
// if radio button X isn't selected then 0 must be
} else {
// displaying 0 in a text box
lbl1 = "0";
// disabling button after been clicked on
Button1.enabled = false;
}
}