Viewing version 8 created 6 months ago by disa.

About the Project

Svetka is eval for ActionScript 3. It uses browser’s Javascript. ActionScript 3 doesn’t have eval function. Nor do previous versions of AS – they have function named “eval” with rather different semantics. The simplest way to evaluate a string is to pass a computation to browser’s JS engine. Since AS 3 it can be done using ExternalInterface class:


import flash.external.ExternalInterface;
...
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.

Competitors

Since I’ve found D.eval I’ve been feeling I’m reinventing the wheel. But my solution seems to be more lightweight, browser-oriented, already supports exception handling and is open source :-)

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 22. 6 months by disa
  2. 21. 6 months by disa
  3. 20. 6 months by disa
  4. 19. 6 months by disa
  5. 18. 6 months by disa
  6. 17. 6 months by disa
  7. 16. 6 months by disa
  8. 15. 6 months by disa
  9. 14. 6 months by disa
  10. 13. 6 months by disa
  11. 12. 6 months by disa
  12. 11. 6 months by disa
  13. 10. 6 months by disa
  14. 9. 6 months by disa
  15. 8. 6 months by disa
  16. 7. 7 months by disa
  17. 6. 7 months by disa
  18. 5. 7 months by disa
  19. 4. 7 months by disa
  20. 3. 7 months by disa
  21. 2. 7 months by disa
  22. 1. 7 months by disa