Alternating Rows in Flash

You can use modulo(%) to check for alternating rows in ActionScript.

var myRow:Object = new Object;
var color0:Number = 0x0000ff;
var color1:Number = 0x00ff00;
for(var i:Number=0; i<10; i++)
{
myRow.rowColor = _root["color"+(i % 2)];
trace(myRow.rowColor);
}

Here is another example of the coloring rows that is a little more compact.  ActionScript with ternary statements is a little more compact and easy to use.

var myRow:Object = new Object; for(var i:Number=0; i<10; i++)
{
i % 2 == 0 ? myRow.rowColor = 0xff00ff : myRow.rowColor = 0xff0000;
trace(myRow.rowColor);
}