GW02
September 27, 2004, 1:13am
1
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.
system
September 27, 2004, 3:48am
2
i am not exactly following you here…
hmm… there is an eval statement in actionscript, though.
system
September 28, 2004, 1:31am
4
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.
system
September 29, 2004, 7:12pm
6
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.