Strings

Well new to the forum, but not to flash. I been trying to code up a graphing calculator for a few days. I have got to the point were now iam working with trying to graph logs and other trig functions. SO what i have did was make a few functions that takes an equation the user inputs and turn it into flash code.

ie if the user puts in y=Log(42x²+19x+7) my final string will come out to FinalString:CommonLog(Math.pow(1,2)42+119+7). Now i was wondering if anyone knew how i could evalute that Strings as if it was

var answer:Number=CommonLog(Math.pow(1,2)42+119+7)

Right now if i do var answer:Number=FinalString i get undefined… anyway if anyone can point me to the right direction it will be greatly appreciated

ps… hope this makes sense :puzzle: