title: Can't remove all objects from ContentFlow coverflow carousel with remove function
body: <p>Before I describe my problem I'd like to outline exactly what I'm attempting</p>
  
  <p>What I'm trying to do here is load different sets of items into a content flow based on buttons a user can press. I've already set up a function triggered by a button that will get the items associated with the name value I pass to it via AJAX (using the jQuery $.get) and put in a div with an ID of itemcontainer. This works great.</p>
  
  <pre><code>function getPictures(Gallery){
  $.get( "getimages.php", {name : Gallery}, function( data ) {
  for(x in data){
      $("#itemcontainer").append(data[x]);
  }
  addPictures();
  }, "json" );
  return false;
  </code></pre>
  
  <p>} </p>
  
  <p>You'll see the function calls another function inside of it ( addPictures() ) that actually adds the pictures to the ContentFlow carousel from the div with an ID of itemcontainer via ContentFlow's addItem method. </p>
  
  <pre><code>     function addPictures(){ 
          clearBox();
          var it = ajax_cf.items;
          // Grabs pictures from 'itemcontainer' and iteratively adds them to 'flow'
          var ic = document.getElementById('itemcontainer');
          var is = ic.getElementsByTagName('img');
          for (var i=0; i&lt; is.length; i++) {
            ajax_cf.addItem(is[i],"end");
          } 
        }  
  </code></pre>
  
  <p>You'll notice that the addPictures() function has a function inside it that I previously declare called clearBox(). clearBox() is supposed to loop through the items in my content flow and remove them so I can delete the old gallery of items in the ContentFlow carousel before loading new ones.</p>
  
  <p>It works by looping through the list items (called items) which is a property of the ContentFlow object ajax_cf I create and run a method rmItem on the list element at index 0 for each item. Here's the clearBox function.</p>
  
  <pre><code> var ajax_cf = new ContentFlow('ajax_cf');
        function clearBox(){
          alert("clear");
          var it = ajax_cf.items;
          var len = it.length;
          for(var i=0; i&lt;len; i++){
           ajax_cf.rmItem(0);
          } 
          return false;
        }
  </code></pre>
  
  <p>If you want you can get the source or the docs here.
  <a href="http://www.jacksasylum.eu/ContentFlow/" rel="nofollow">http://www.jacksasylum.eu/ContentFlow/</a></p>
  
  <p>Thanks in advance!</p>