# Problem with Radio Button Component

**URL:** <https://forum.kirupa.com/t/problem-with-radio-button-component/194186>\
**Category:** flash\
**Created:** [July 21, 2006, 4:57am UTC](https://forum.kirupa.com/t/problem-with-radio-button-component/194186 "2006-07-21T04:57:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saikiran](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@saikiran](https://forum.kirupa.com/u/saikiran)\
**Post date:** [July 21, 2006, 4:57am UTC](https://forum.kirupa.com/t/problem-with-radio-button-component/194186/1 "2006-07-21T04:57:55Z")

</div>

hi to all,

I want to do this in my small quiz which i am making.

I have two radio buttons, named r1 and r2 respectively.

User will select any one of the radio button and press the next button.

[SIZE=3]**[COLOR=Red]Whenever user wants to go back to the previous question, they press the back button, and the option that they already selected should be highlighted.[/COLOR]**[/SIZE]

To do this, what i did is

1. stored the selection in an Array and then wrote a function to check whether the index is true, then i try to re set the same radio button.

I am not getting it as i want. May be some error in my script…

This is the code

[COLOR=Red]//array used to store the radio button selection

var userChoice:Array = [];

//a function to check which radio button instance was selected

function disp\_dot():Void  
{

```
if(r1.selection==true)
{
    r1.selection=true;
}
if(r2.selection==true)
{
    r2.selection=true;
}

```

}

in the prev. button, i am calling this function

//prev button script

on(release)  
{  
\_root.disp\_dot(); // routine called

prevFrame(); //jumped to prev. question

}  
[/COLOR]

can anyone help me out, as i have to finish this assignment quickly

cheers  
sai  
[saisen76@hotmail.com](mailto:saisen76@hotmail.com)
