Skip to main content
Participating Frequently
October 5, 2007
Question

Deselect radio buttons

  • October 5, 2007
  • 4 replies
  • 498 views
Is there a way to deselect all the radio buttons in a group? what I'm specifically trying to do is, once the user has selected the radio button and clicked my button to proceed to the next question in my quiz, it will load a new question and new radio button labels/values. that part works, but the radio button previously selected is still selected. I have tried:
radioGroup.selection = null:
radio_btn0.selected = false; (and repeat for the other 3)
and the same as above in a for loop.
None of this seems to work. Is this possible, or will one always be selected once the user interacts with the radio group the first time?
This topic has been closed for replies.

4 replies

kglad
Community Expert
Community Expert
October 6, 2007
you can use removeMovieClip() to remove radio button instances.
DestrypAuthor
Participating Frequently
October 5, 2007
I tried <removeRadioButton> to clear the instances, but that just disabled interaction with the radio button and didn't change the display. As of now I made a 5 radio button that is invisible, and when the next question loads it's <selected> property is set to true.
kglad
Community Expert
Community Expert
October 5, 2007
are you using the same instance name for more than one object? ie, when you "..load a new question and new radio button labels/values" are you using the same instance names? if so, are the previous instances removed?
DestrypAuthor
Participating Frequently
October 5, 2007
I put radio buttons on the stage drag-and-drop style, rather than have them generated at runtime, and no I don't have any code to remove previous instances. I'll try adding code to add and remove those as the script runs and see what I come up with. I'm still an incredible newbie, so even though I know what I want to happen it takes me a while to figure out how to code it.
kglad
Community Expert
Community Expert
October 5, 2007
you must have a typo somewhere. copy and paste (using the attach code option) your code if you're still having trouble.
DestrypAuthor
Participating Frequently
October 5, 2007
Here is the code for a function I attached to a button.