// what i have
ans1 = pollSet.getItemAt(0).ans1;
ans2 = pollSet.getItemAt(0).ans2;
ans3 = pollSet.getItemAt(0).ans3;
ans4 = pollSet.getItemAt(0).ans4;
ans5 = pollSet.getItemAt(0).ans5;
// what i want
for (var k:Number = 0; k < numans; k++){
var j:Number = k + 1;
this['ans'+j] = pollSet.getItemAt(0).this['ans'+j];
}
the error i get: Expected field name after ‘.’ operator
my question: How would I go about declaring a dynamic variable based on the field name like I’m attempting to? Of course I could leave it the way I have it, but for future reference, how would I harness the scope of “this”?