0
votes

If I have the user type something like movieclip.x += 1; and press a button could I make the user's text execute? Such as a Script Src?

2

2 Answers

0
votes

Unfortunately AS3 doesn't provide any built-in evaluate function, so I think you should be forced to roll your own "interpreter" to get that working. Or maybe you can use some 3rd party lib (like Eval).

0
votes

It can be done but its fairly complex - there are libraries that generate byte code (ie a swf) on the fly - that can then be run in same way as loading any other swf.

For an example, see http://wonderfl.net/

Sorry i cant give you any specific code or libraries (i cant remember where i've seen the libraries, but they are out there), but i figured it is better than nothing :)

Edit:

I think this is where i orginally heard about it: http://www.jamesward.com/2011/04/26/introducing-mixing-loom-runtime-actionscript-bytecode-modification/