One small issue. I cleaned up the code on the buttons but having an issue with stotal value.
If you compile and run this FLA, select the first then the second then the third choices then deselect in reverse till all are deselected you will see it returns an invalid number , should be zero (0), it also displays 4 decimal places, I have tried to add a function to limit to 2 decimal places but I can't seem to get it to work and even though I need that function not sure if it will fix the bad end value.
To fix the calculation bug is also really simple.
add _root.
Actionscript Code:
_root.stotal -=20.4;
Adding that to them all will fix that issue I am tempted to say loop everything
I have attempted this though failed to get it to work, you can post this for others if you like depends what method you prefer as a beginner maybe best to use your method.
where the 2 100's are states the dp lenght so if both are 10 its 1dp, and if both are 1000 its 3dp, this replaces the old
ttotal = Math.round(stotal);
also I forgot to say you can remove all the a1a=0; - a1j=0;
They have no function
If you play with the loop make sure you back up the origional as its not a working file at the moment the loop works bit it doesnt get the values from the array atm.
Also add the stop(); to the top of the actions frame rather than having it seperate.
One last question. If you run this and click the 2nd or 4th option they return 1/100 less than actual value. The first has a value of 20.40 and returns 20.39, and the second has a value of 18.40 and returns 18.39. I have a trace in there and it returns the correct value. Strange, rounding function looks correct.