User Guide

296 Chapter 2: ActionScript Language Reference
You can also use the following ActionScript:
for (var i = 1; i<=3; i++) {
this["square"+i+"_mc"]._rotation = -5;
}
See also
Array class, set variable