Hi, I have a class file that contains a for in loop. basically there are 50 states (movieclips) on the stage and here is what I have:
public var statesArray:Array = ['alabama_mc', 'alaska_mc', 'arizona_mc', 'arkansas_mc', 'california_mc'];
private var states:String;
public function Delegates() {
//all of the state movieclips need to be alpha 0.
for ( states in statesArray ) {
//this[ states ].property = value;
this[ states ]._alpha = 0;
trace(states);
trace(statesArray[states]);
}
I don’t think I understand enough about arrays or for in loops to understand why this isn’t working… it traces the array, but not statesArray[states], and it doesn’t change the alpha of anything.
Please help! thanks!