saikiran
07-21-2006, 07:11 AM
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.
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.
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
//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
}
can anyone help me out, as i have to finish this assignment quickly
cheers
sai
saisen76@hotmail.com
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.
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.
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
//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
}
can anyone help me out, as i have to finish this assignment quickly
cheers
sai
saisen76@hotmail.com