I have four radio button groups with each button having a specific value. When I submit the selections (via a push button), I need to add the values together and play a specific movie based on the total value of the four selected buttons. Any ideas on how to do this? I am not very good at AS yet, and I am working with Flash MX2004.:krazy: Thanks for any and all help.
Here’s what I have so far. I don’t get any error messages, but I don’t get any results either.
stop();
// Radio buttons
pump1 = “1”;
pump2 = “2”;
pump3 = “3”;
tide1 = “4”;
tide2 = “5”;
tide3 = “6”;
debris1 = “7”;
debris2 = “8”;
debris3 = “9”;
fish1 = “10”;
fish2 = “11”;
// set value vars.
function onChange() {
item1 = pump_radio.getValue();
item2 = tide_radio.getValue();
item3 = debris_radio.getValue();
item4 = fish_radio.getValue();
}
// set ChangeHandlers
pump_radio.setChangeHandler (“onChange”) ;
tide_radio.setChangeHandler (“onChange”) ;
debris_radio.setChangeHandler (“onChange”) ;
fish_radio.setChangeHandler (“onChange”) ;
// calculate grandtotal
grandtotal = Number(item1)+Number(item2)+Number(item3)+Number(item4);
// function for submit button
onSubmit = function () {
switch (grandtotal) {
case 22 : gotoAndPlay(“Scene2”,1); break;
case 23 : gotoAndPlay(“Scene3”,1); break;
default : stop();
}
}