Try using the Array access operator []
:
this[country + "_clicked"] = true;
There are some other alternatives as well (old method from Flash 4 apparently):
set(country + "_clicked", true);
Or, don't use eval()
on the left side of the assignment operator (=
), this was probably added for security reasons:
var foo = eval(country + "_clicked"); // eval() is used on the right!
foo = true;
I've never programmed in AS2 (only AS3), so hope this helps. It's explained very nicely in this blog post.