title: Flex looping through object
body: <p>Im trying to extend the flex ArrayCollection to be able to search for an object containing specific data and give it back.</p>
  
  <p>Here is my function:</p>
  
  <pre><code>public function getItemContaining(value: String): Object {                      
            //Loop through the collection         
            for each(var i: Object in this) {                             
              //Loop through fields                               
              for(var j: String in i) {                   
                  //If field value is equal to input value
                  if(i[j] == value) {
                      return i;
  
                  }
              }
          }
      //If not found
      return null;
      }
  </code></pre>
  
  <p>Problem is j is always null so the second loop never works. So I read flex loop descriptions and actually it should work just fine. What can possibly be the problem? </p>