In AS2 set()
function does the assignment. First parameter is variable name as String
, second parameter is the value you want to assign.
Important thing to note about first parameter, is that if you have a variable say:
var color:String = "orange";
and you call
set(color, "blue"); // will *not* work as intended
then variable color
will not be set to "blue", instead new variable named "orange"
will be created and value "blue" assigned to it.
set("color", "blue"); // will work as intended
In your example function set()
assigns whatever data is in variable evalOpt
to variable name that evaluates from "ans"+plcObj