Home

History Key

  • New content
  • Removed content

Recent Versions

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

  1. 22. about 4 years by disa
  2. 21. about 4 years by disa
  3. 20. about 4 years by disa
  4. 19. about 4 years by disa
  5. 18. about 4 years by disa
  6. 17. about 4 years by disa
  7. 16. about 4 years by disa
  8. 15. about 4 years by disa
  9. 14. about 4 years by disa
  10. 13. about 4 years by disa
  11. 12. about 4 years by disa
  12. 11. about 4 years by disa
  13. 10. about 4 years by disa
  14. 9. about 4 years by disa
  15. 8. about 4 years by disa
  16. 7. about 4 years by disa
  17. 6. about 4 years by disa
  18. 5. about 4 years by disa
  19. 4. about 4 years by disa
  20. 3. about 4 years by disa
  21. 2. about 4 years by disa
  22. 1. about 4 years 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.

“Great! That’s what I need!”

To learn how to use Svetka, first read Kickstart page.

Licensing

Svetka is distributed under the terms of GPLv3Apache licenseLicense 2.0.

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 and already supports exception handling while D.eval does not. And most important that mine is open source :-)