This statement allows you to iterate over a collection, with an optional qualifier.
The statement has 2 main sections:
for each section specifies what to enumerate over, and which variable to bind each item to
// looks at each item in the collection,
// the variable "item" will receive each item in the iteration
for each item in collection {
trace(item.name);
}
In this example, a qualifier is added:
// looks at each "simple" item in the collection,
// the variable "simple_item" will receive each item in the iteration
for each simple simple_item in collection {
trace(item.name);
}
The underlying code interprets the qualifier in whatever way is appropriate to it.
Note: you have to use the braces "{" and "}" to surround the statements after the for clause.