As3 Eval updated
I’ve grabbed some recent .abc binaries from the Mozilla Tamarin repository. The ESC project is moving along quite nicely apparently, as this version is able to compile a lot more constructs. For example, it has enough namespace support to let scripts access objects located in other packages (see the sample code on the “Eval UI” tab in the demo.)
I’ve tweaked the way those binaries get injected within the player, which fixes a few bugs (such as chunks of bytecode getting GC’d before they have a chance to run..woops.)
Anyway, give it a whirl. I’ve finally included the es4eval.swc file too. I’ve another little project that builds on this stuff that I’ll blog about soon.
Explore posts in the same categories: web, actionscript, eval
May 20th, 2008 at 6:02 pm
Thanks for making the swc binary available! I was able to build the lib after peeking inside. I presume you’re excluding some of the actionscript files because they present build/runtime issues?
June 1st, 2008 at 10:04 am
hi,
this is a very amazing tool. I’ll try to integrate to our flash app. User could extend the app by scripting.
Security should be considered. Now the byte code is Loaded as a child of the main app so if I have a static function that destroys something in the app, a script will be able to call this.
Could you please help me to think about the next solution: my app is running in a domain. I put some kernel code in a child domain. The kernel can use the app domain.
Then I load the compiler as a separeted domain and load the compiled byte code as a child of this.
I haven’t found nothing similar to this.
peter
June 10th, 2008 at 5:26 pm
Question: would it be possible to have a Flash SWF running in standalone to load a “Class.as” file and then compile it into a SWF in which the parent SWF loads?
I’m looking to build an open source AS3 compiler in Flash and see if there is a better way for application deployment… mainly in development scenarios.
The compiler would not need to debug much… just show an error if something is wrong with the data being compiled.
Thanks for this awesome lib… keep up great work
June 29th, 2008 at 7:44 pm
Hi Hurlant, just to THANK YOU, for such a tremendous work, it fits perfectly in a project I am working on, I’m really happy… really man, thank you I should get you a beer
Greetings from Mexico!
July 3rd, 2008 at 9:16 pm
simply awesome…
are you thinking to modify some part of this lib???
What are the limitations???
Thank you to distribute this lib in a free license
September 24th, 2008 at 10:22 pm
Hi ,
I’m trying to integrate to flex-eval-application using AS3Eval-Library.
This application uses Abc.as, ABCFile.as etc…
So, I found following two bugs in com/hurlant/eval/abc/Abc.as.
1. In public static function parseTrait()
(1) actual lines (bug lines)
var kind = tag&0×04;
var attrs = (tag>>4) & 0×04;
(2) expected lines
var kind = tag&0×0f;
var attrs = (tag>>4) & 0×0f;
2. In public static function parseMethodInfo()
(1) actual lines (bug lines)
optionals[i] = [b.readU32(), b.readByte()];
(2) expected lines
optionals[i] = { val : b.readU32(), kind : b.readByte() };
HarHid.
October 13th, 2008 at 8:40 am
Hi,
I just got the latest build from the tamarin repository and I still cant compile packages/namespaces. Is there something im missing?
For example…
package Test{
public class A{
public function A(){}
}
}
new Test.A();
… will not compile because of the package keyword. Does anyone know how to get the tamarin esc to compile packages or namespaces?
November 3rd, 2008 at 10:32 pm
Will be nice if As3 Eval will show mx_internal, private and protected members and accessors from loaded SWF file. Looks like only using byteArray we can get these properties, because describeType method cannot provide that information. Any suggetion how can I use it?
var classInfo:XML = describeType(getDefinitionByName(”mx.core.Application”));
trace(classInfo);
November 11th, 2008 at 5:28 pm
Hey Metal,
I’m working on a dynamic lisp compiler, written in AS3, and making use of AS3Eval: https://github.com/aemoncannon/las3r/wikis
I have some questions related to Loader#loadBytes and I’m hoping you could shoot me an email so we can discuss further (I couldn’t find your email).
Thanks, and great work on AS3Eval.
-Aemon
January 27th, 2009 at 12:34 pm
Haven’t seen any updates on this fantastic project in a while… Any chance you’re interested in dropping it in a git repo or on Google code (or something) so that we can all collaborate? I’d be interested in contributing.
March 14th, 2009 at 10:53 pm
Hey.
I have a question regarding reflection in AS3, and specifically, dynamic instantiation ne Factories.
For example, i’d like to be able to call Factory.newInstance(’myClass’, arg1, arg2,…), and retrieve a new instance of a registered Class.
What I have in place right now is a rather terrible switch, that just runs the constructor based on the arguments given.
If eval() was available, I’d even be able to eval an arbitrary length constructor.
What would be best practices would be to be able to grab the argument count of the Class constructor*, throw errors as appropriate, and write / evaluate a little bytecode to instantiate the Class.
* Can we peek into precompiled bytecode?
March 15th, 2009 at 7:01 pm
Ok, I’ve pulled out the Loader method for executing arbitrary bytecode, and tested that I can build and load an SWF with the arbitrary code loaded in. I’ve got the basic bytecode I’ll need to generate a method that can instantiate a generic class using X arguments.
My next task is to get arguments (Class, Array) in and a return value (Object) out. Any ideas?
July 17th, 2009 at 8:14 am
Just curious if there is any ETA or level of effort on interfaces/inheritance. Please e-mail response if you can. Thank you.
May 11th, 2021 at 6:44 am