Evaluating string

Hi,
I’d like to know one thing, that could make my life much easier. I need to evalueate a string as code… let me show you an example…

Lets say, that I have a string:

string = "Math.cos(var1)*Math.sin(var2)";

And what I need to do, it to use its contents as code and not string like here:

var3 = Math.cos(var1)*Math.sin(var2);
// but I need to use something like... I know(I think)
// that eval is not useable in this case
var3 = eval(string)

Any help wil be appreciated. :smiley: