title: AS3 Remove element from array (of objects) generically
body: <p>Is there a way to generically remove an object from an array?<br>
  (maybe not using array.filter or creating a new array)</p>
  
  <p>Example:</p>
  
  <pre><code>var arr:Array= new Array();    
  //create dummy objs
  for (var i:uint=0; i &lt; 10; i++){
              var someObject:SomeClassObject = new SomeClassObject();
              someObject.Name ="Amit"+ i;
              someObject.Site="http://www.mysite.com/"+i;
             //...many more props
              arr.push(someObject);
   }
  //
  removeElement("Amit4",arr);
  removeElement("Amit8",arr);
  //...so on so forth
  </code></pre>
  
  <p>Currently im using array.splice() to remove object</p>
  
  <pre><code>for (var i:Number=0; i &lt; arr.length; i++)
      {
          if (arr[i].Name == element)
          {
              arr.splice(i, 1);
          }               
      }
  </code></pre>
  
  <p>I want to write removeElement in such a way that i can use it for different 
  types of objects.<br>
  currently removeElement becomes dependant on implmentation..<br>
  Suppose if i want to remove a file from array of files given file name..i wud have to
  again write "removeElement" by changing criteria.</p>
  
  <p>Also may be i can vary the criteria varing criteria?
  example : </p>
  
  <pre><code>arr= removeElement("Site","http://www.mysite.com/6",arr)
  </code></pre>
  
  <p>will remove object from arr whose "Site" property is equal to "http://www.mysite.com/6"
  (using above example)</p>
  
  <pre><code>ie. removeElement(criteria:object,criteria_value(s):object,arr)
  </code></pre>
  
  <p>Thanks All.</p>