Posted By

vorp on 05/17/11


Tagged

loop for foreach each


Versions (?)

For each in


 / Published in: ActionScript 3
 

  1. var arr:Array = ["test", "test2", "test3"];
  2.  
  3. // Use a regular for in loop to access the properties in arr
  4. for ( var i in arr ) {
  5. trace( i );
  6. }
  7.  
  8. // Use the new for each in loop to access the values in arr
  9. for each ( var s:String in arr ) {
  10. trace( s );
  11. }

Report this snippet  

You need to login to post a comment.