I'm 95% sure that this can't be done, because SWF files are
compiled and the Flash player does not provide a JIT compiler
(unlike Java and .NET).
I was thinking about a brute-force trick, but I'm sure it
won't work. Anyway I'll tell you. You let the script create a local
.as file with the script within the string variable, and then run
an include("tempfile.as") instruction from a function inside an
external .as file. The problem is that I don't know if .as files
can be live-interpreted.
The only trick you can do is to process the request
server-side. PHP and ASP.NET allow you to run custom code and
return the value you want. I have a VB.NET example on my book,
about parsing math functions.
If your application runs server-side you may opt for this
elegant solution that, unfortunately, wastes bandwidth and puts
your server in
severe security danger.