Can someone explain to me why I'm getting an error here? The problem I'm ultimately trying to solve is much larger and more complex, but I have reduced the specific problem I'm having can be reduced to this I believe:



//EXAMPLE ONE
var myVar = null;
_root.myVar = 1;
trace(_root.myVar);

//EXAMPLE TWO
var myVar = null;
(eval("_root.myVar")) = 1;
trace(_root.myVar);

//EXAMPLE TWO generates error:
//Left side of assignment operator must be variable or property.