title: How to remove an item while iterating over collection?
body: <p>I would like to use the AS "for each" syntax to loop over a collection of items. Within the loop I sometimes need to remove an item from the collection I am iterating over.</p>
  
  <p>Using a "for" loop, I would code this like (<strong>note the "--" operator to move the index back</strong>):</p>
  
  <pre><code>for (var n:int=0; n&lt;ac.length; n++) {
      var s:String = ac.getItemAt(n) as String;
      if (s == 'c')
          ac.removeItemAt(n--);
  }
  </code></pre>
  
  <p>Is it also possible to do something similar using a "for each" construct?</p>