/ Published in: ActionScript 3
use AS3's new for each loop to iterate through array items. The first loop will output 0,1,2. The new loop will output the property names, item1, item2, item3
Expand |
Embed | Plain Text
var myArray = ['item1', 'item2', 'item3']; // original way for(var i:int in myArray) { trace(i); } // new for each in loop for each(var j:String in myArray) { trace(j); }
You need to login to post a comment.
