CLICK HERE TO COPY
Actionscript:
var txt:TextField = TextField(addChild(new TextField()));
txt.autoSize = TextFieldAutoSize.LEFT;
var myVar:Number = 100;
// works as an expression parser
txt.text = js("return (" + myVar + " * 2 + 10) / 2");
txt.appendText("\n\n");
// parses javascript
txt.appendText(js("var a = []; for (var i = 0; i<10; i++){ a.push(i) } return a;"));
function js( data:String ):*{
var res:*= ExternalInterface.call("function(){" + data [...]