Question : Simple Question about Radio Buttons in Flash

Hello,I seem to be having trouble using radio buttons with Flash and as 2.
Here is the problem. I am currently coding an exam entirely in Adobe Flash. It is a simple multiple choice exam, where there are four choices underneath each question. When the user selects the right answer, a point is added to the dynamic textbox with the variable name " total". At this point it should be added that the answers will only be selected when the user clicks on a radio button, they will be added to the textox when he/she clicks the submit button (where the actionscript code is). Please check the code attached to see what I have so far. I have successfully created this same kind of exam online with PHP and MySQL but seem to have trouble migrating to Flash. Whenever I use the code below, I get the several syntax errors.

Can anyone tell me where I wrong?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
on (release) {
    if (q1.getValue()=="4") {
	_root.total = _root.total + 100;
    }
else {
	_root.total = _root.total + 0;
    }

    if (q2.getValue()=="18") {
	_root.total = _root.total + 100;;
    } else {
	_root.total = _root.total + 0;
    }
}
        _root.total = _root.total + 100 ;

Answer : Simple Question about Radio Buttons in Flash

first of all... why are you adding 100 point in the end... well... I don't know what's coming in the "getValue()" anyway... the best way for your code is:
1:
2:
3:
4:
5:
6:
7:
8:
on (release) {
    if (q1.getValue()=="4") {
	_root.total = _root.total + 100;
    }
    if (q2.getValue()=="18") {
	_root.total = _root.total + 100;
    } 
}
Random Solutions  
 
programming4us programming4us