result = !ExternalInterface.call("eval", expression);
The problem is we can not access AS runtime variables and objects within ExternalInterface.call. Primitive typed variables are perfectly passed through the AS/JS interface, but say variables of Function type can not be passed. Thus objects’ methods can not be passed either. The solution is to create objects on-the-fly on the JS-side with stub methods calling corresponding methods on the AS-side.
This what is done with Svetka. Sounds quite simple, but a number of design problems has been carefully solved during the development.
“Great! That’s what I need!”
To learn how to use Svetka, first read Kickstart page.