flashactionscriptactionscript-3avm2

How do Adobes AS3-"Core-Libraries" function?


First of all, I could not decide if I should ask this here or at "programmers", please be gentle ;)

I wonder what happens under the hood in what I would call "core libraries" of AS3 (yes, that might not be the exact term in this case, but now you have an idea what I mean nevertheless).

So for instance, when I type:

var shape:Shape = new Shape();
shape.graphics.beginFill( 0xff0000 );
shape.graphics.drawCircle( 100, 100, 100);

...what exactly happens in the graphics-object? I assume that it will be calls to a rendering API of the AVM2, but how does this look like? Is there any way to look at it, or are these sources completely closed for anyone outside of Adobe?

Thanks!


Solution

  • My suggestion would be compile something simple (like what you have above), and run it through something to dump out the abc (Actionscript Byte Code), the code that gets executed in the virtual machine.

    You can try the abcdump and swf2abc projects.

    Start by reading the bytecode of something really simple and see what you think :)