Select all that apply programming help


I’ve created this interaction for a project and I have most all of it working. I’m doing this in Flash CS3 but with AS2.

The part I’m having trouble with is programming so that when the user clicks on the checkbox it adds 1 to the variable but if the click it again to deselect that box that it subtracts one from the variable total.

This interaction has 5 parts A-E. Each section totals how many they have selected independantly then on the results page it determines which section the user selected the most in and that determines which feedback they get.

I was able to get it all working having the variable add 1 its the having it subtract 1 when they deselect that I’m having a problem with. When I was just adding 1 this is what the button code looked like (this part did work)

A01_btn.onRelease = function() {;
ATotal = ATotal + 1;

Each button is the statement with the checkbox inside it. The checkbox animates a checkmark appearing when the user clicks on it. So when the checkbox is on currentframe 1 the box is NOT selected, if its on a frame greater than 1 it is selected

So with that I tried doing it this way

A01_btn.onRelease = function() {;
if (A01_btn.A01_box._currentframe>1) {
ATotal = ATotal+1;
if (A01_btn.A01_box._currentframe==1) {
ATotal = ATotal-1;

but that didnt work. I have uploaded the FLA. I made it a watered down version with only the part I’m working on in it.

Please Help!