Flash Calculator Problem

Hello all:

I’m trying to build a calculator in flash that calculates the number of portable toilets needed based off of amount of people at the event, how many hours it is going on, and whether or not alcohol is being served. The amount of people values are in a comboBox as is the number of hours and the “Is there alcohol being served” question is controlled by yes and no radio buttons.

There is a textbox component that automatically updates it’s value based on what is selected and it is working fine except for the radio buttons. If the user chooses no, there is no value change, but if they select yes, the textbox component is supposed to increment to it’s current value x 1.13, which is a rounded number.

I have a listener attached to the radio buttons, but I just can’t seem to crack it. Here is my code:

var toiletsGrid:Object = new Object();
toiletsGrid.a = new Array("2","2","2","2","2","3","3","3","3","3");
toiletsGrid.b = new Array("2","3","3","4","4","4","4","4","4","5");
toiletsGrid.c = new Array("3","4","5","6","6","7","7","7","7","7");
toiletsGrid.d = new Array("5","8","10","11","12","13","13","14","14","14");
toiletsGrid.e = new Array("7","12","15","16","18","18","19","20","20","21");
toiletsGrid.f = new Array("10","16","19","22","24","25","25","27","27","28");
toiletsGrid.g = new Array("12","20","24","27","29","31","32","33","33","34");
toiletsGrid.h = new Array("14","24","28","33","35","37","37","39","41","41");
toiletsGrid.i = new Array("17","27","34","38","41","42","46","46","47","48");
toiletsGrid.j = new Array("20","32","38","44","48","49","50","51","53","54");
toiletsGrid.k = new Array("24","39","47","54","58","62","64","66","67","68");
toiletsGrid.l = new Array("30","48","61","68","73","78","80","81","82","85");
toiletsGrid.m = new Array("37","57","70","81","87","92","94","99","102","104");
toiletsGrid.n = new Array("42","68","84","95","100","110","111","113","116","118");
toiletsGrid.o = new Array("48","77","95","107","115","120","127","131","133","136");
toiletsGrid.p = new Array("60","96","122","133","146","156","159","162","165","171");
toiletsGrid.q = new Array("73","114","141","163","174","184","188","194","197","201");
toiletsGrid.r = new Array("95","156","188","217","231","243","249","257","266","271");
toiletsGrid.s = new Array("120","192","238","267","290","305","312","322","330","337");
toiletsGrid.t = new Array("177","292","357","403","432","455","470","485","491","508");
toiletsGrid.u = new Array("239","378","475","515","542","562","583","593","620","633");

function updateMenus() {
        var sel:Number = _root.comboBox1.selectedIndex;
        var theHours:Number = _root.comboBox2.selectedIndex;
        var toiletMatrix:Object = new Object();
        if (sel == 1) {
               toiletMatrix = toiletsGrid.a;
        } else if (sel == 2) {
               toiletMatrix = toiletsGrid.b;
        } else if (sel == 3) {
               toiletMatrix = toiletsGrid.c;
        } else if (sel == 4) {
               toiletMatrix = toiletsGrid.d;
        } else if (sel == 5) {
               toiletMatrix = toiletsGrid.e;
        } else if (sel == 6) {
               toiletMatrix = toiletsGrid.f;
        } else if (sel == 7) {
               toiletMatrix = toiletsGrid.g;
        } else if (sel == 8) {
               toiletMatrix = toiletsGrid.h;
        } else if (sel == 9) {
               toiletMatrix = toiletsGrid.i;
        } else if (sel == 10) {
               toiletMatrix = toiletsGrid.j;
        } else if (sel == 11) {
               toiletMatrix = toiletsGrid.k;
        } else if (sel == 12) {
               toiletMatrix = toiletsGrid.l;
        } else if (sel == 13) {
               toiletMatrix = toiletsGrid.m;
        } else if (sel == 14) {
               toiletMatrix = toiletsGrid.n;
        } else if (sel == 15) {
               toiletMatrix = toiletsGrid.o;
        } else if (sel == 16) {
               toiletMatrix = toiletsGrid.p;
        } else if (sel == 17) {
               toiletMatrix = toiletsGrid.q;
        } else if (sel == 18) {
               toiletMatrix = toiletsGrid.r;
        } else if (sel == 19) {
               toiletMatrix = toiletsGrid.s;
        } else if (sel == 20) {
               toiletMatrix = toiletsGrid.t;
        } else if (sel == 21) {
               toiletMatrix = toiletsGrid.u;
        } else {
            toilets = "Please Call";
        }
        var item = Number(item);
        var theHours = Number(theHours);
        var item:Number = toiletMatrix[theHours];
        if (_root.no.selection.data = 1) {
            item = item * 1;
        } else if(_root.yes.selection.data = 1.13){
            item = item * 1.13;
        }
        item = Math.round(item);
        _root.textBox.text = item;
    }

function change(evt){
    updateMenus();
}
comboBox1.addEventListener("change", this);
comboBox2.addEventListener("change", this);
radioGroup.addEventListener("change", this);

Thanks for your help.

JPearson311