3 Replies Latest reply on Feb 26, 2009 12:39 PM by kglad

    Check multiple checkboxes for selected

    chieffan Level 1
      I want to see if I can reduce my code more. I have five check boxes on the screen and when they are all checked, I want to call a function. I don't want to have a long if statement because I will re-use this and would prefer to have as streamlined as possible. Here is my code now. Thanks.

      var checkboxListener:Object = new Object();
      checkboxListener.click = function(evt_obj:Object) {
      for (cb=1; cb<6; cb++) {
      if (_root["c"+cb+"_ch"].selected) {

      for (cb=1; cb<7; cb++) {
      function nextItem() {
      if (c1_ch.selected && c2_ch.selected && c3_ch.selected && c4_ch.selected && c5_ch.selected && c6_ch.selected) {
      trace("do something") }