Radio buttons are disappearing whenever I group them

Hi guys first time posting,

I have an assignment where I need to make 5 question survey. I am to use radio buttons but I am running into the problem where all the radio buttons are in one group so when I answer another question, the answer to the previous question disappears. So I tried grouping them into different groups. 5 groups for 5 questions. However when I do that I encounter another problem where the radio button disappears but the text is still next to it. I’m also able to click the radio button. 

Here’s a visual if I am being unclear… I only put the first two radio buttons in a group hence they’re missing but still clickable.

TtMDzIV.png

This is the code: 

yesSwitch = widget.newSwitch

    {        

    x = 100,

    y = 100,    

    style = “radio”,    

    initialSwitchState = false,

    onEvent = showChoices

    }

radioGroupOne:insert( yesSwitch)

yestext = display.newText( “Yes”, 0, 0, Arial, 32 )

    yestext.anchorX, yestext.anchorY = 0, 0.5

    yestext.x, yestext.y = 130, 100

    yestext:setFillColor( 0, 0, 0.6 )

        

noSwitch = widget.newSwitch 

    {        

    x = 100,    

    y = 150,            

    style = “radio”,        

    initialSwitchState = false,    

    onEvent = showChoices

    }

radioGroupOne:insert( noSwitch)

notext = display.newText( “No”, 0, 0, Arial, 32 )

    notext.anchorX, notext.anchorY = 0, 0.5

    notext.x, notext.y = 130, 150

    notext:setFillColor( 0, 0, 0.6 )

Hi @eric.hom665,

Is there some object obscuring (overlapping) the first pair of buttons? I notice the background is white (default is black). Did you create a white vector rectangle for that, or did you set the background color to white via a command? Can you show more of your code that gets executed before you output the radio buttons?

Thanks,

Brent

Hi @eric.hom665,

Is there some object obscuring (overlapping) the first pair of buttons? I notice the background is white (default is black). Did you create a white vector rectangle for that, or did you set the background color to white via a command? Can you show more of your code that gets executed before you output the radio buttons?

Thanks,

Brent