So eval() in Flash doesn't work the same as in JavaScript. Fair enough. Can someone please explain to me why the following code doesn't work in Flash (MX)?

PHP Code:
var executors = [];
function 
exec(funcargs) {
    if (!
executors[args.length]) {
        var 
bodya;

        
body "return func(";

        for (
args.length ; ++a) {
            if (
0)
                
body += ", ";

            
body += "args[" "]";
        }

        
body += ")";

        
executors[args.length] = new Function("func""args"body);
    }

    
executors[args.length](funcargs);
}

function 
testFunc(msg1msg2) {
    
trace("msg1: " msg1 "; msg2: " msg2);
}

exec(testFunc,["foo","bar"]); 
That code should write "msg1: foo; msg2: bar" to the message window. Instead it just sits there and kind of fiddles with its hair. My guess is that the parser won't interpret the function body.

Any ideas on why this doesn't work in AS, but does in JS?