In-line evaluation

Is there any function in flash that allows for ‘in-line evaluation’?

For example, in php I can type

eval ( ‘php statement here’ );

and php will execute ‘php statement here’ as if I typed it as a command. I’m trying to execute dynamic code is the problem.

i am not exactly following you here…

hmm… there is an eval statement in actionscript, though.


http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary200.html


Right, I know of that one, but it doesn’t provide the desired effect.

That eval statement lets you pass a string and it will treat the string like an object reference in your code.

I want one that lets you pass a string and it will execute the string like a line of code.

For example:


execstring = "somevariable = Math.PI * anothervariable"
if ( some condition )
execstring += " ^2;"
else
execstring += ";"
eval ( execstring );

And have it treat the string execstring as if it was a statement.

It’s not a very good example but it gets the point across.

Anyone?

asked this question awile ago (i went for the toCode(someString) approach ;)) no replies tho. also recall a similar questin a long time ago so i think the answer here is…

no…

unfortunately…

Prophet.

No, there isn’t.