7 Replies Latest reply on May 25, 2010 7:54 PM by Miggl

    for each ... in ... as ...?

    Miggl

      Hi guys,

       

      I'm familiar with the for each ... in ... syntax (http://livedocs.adobe.com/flex/3/html/03_Language_and_Syntax_16.html#163492), but coming from PHP background, I was wondering if the following is possible:

       

       

      for each (var item:Object in array:Array as var value:Object)

      {

           trace("Item '" + item.toString() + "' has the value '" + value.toString() + "'.");

      }

       

      instead of doing:

       

      for each (var item:Object in array:Array)

      {

           trace("Item '" + item.toString() + "' has the value '" + array[item].toString() + "'.");

      }

       

      While this appears simple enough in this example, it would come in handy once in a while.

      Thoughts?