title: unchecking multiple checkboxes AS3
body: <p>I have a placeholder movieclip on stage named cbHolder and some code that creates a series of checkboxes, 33 in all, assigns an 'ON CHANGE' event listener to each of them and then adds them into the cbHolder MC. The event listener fires the function iChanged which looks like this:</p>
  
  <pre><code>var cbSearchArray:Array = new Array();
  function iChanged(event:Event):void{
  if (event.target.selected == true){
          trace(event.target.name + " is checked");
          cbSearchArray.push(event.target.name);
          trace("array is:" + cbSearchArray);
          }
          else{
              trace(event.target.name + " is unchecked");
              cbSearchArray.splice(cbSearchArray.indexOf(event.target.name), 1);
              trace("array is:" + cbSearchArray);
              }
      }
  </code></pre>
  
  <p>This all works great, adds and removes array elements like a thing possessed and I'm really pleased. I didn't know I had it in me... but what I'm really stuck on right now is an efficient way of unchecking all checkboxes, or checking all beckboxes via a button. When I try and iterate through the array with a for loop and try setting the checkbox with</p>
  
  <pre><code>cbSearchArray[i].selected = false;
  </code></pre>
  
  <p>I get the error: Cannot create property selected on String. I don't understand why Flash is not seeing them as object names..!! If I try</p>
  
  <pre><code>cbHolder.cbSearchArray[i].selected = false;
  </code></pre>
  
  <p>I get the error: A term is undefined and has no properties.</p>
  
  <p>I'm totally, totally lost and after goggling for a whole day I've come across nothing that will help. In the hope that someone can point me in the right direction I'm posting it here and asking for help.</p>