Вопрос

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!

Это было полезно?

Решение

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 :)

Другие советы

I concur with @sberry's suggestion to look at some byte code.

But before you do that, you might want to look into the AVM2 wiki.

The following video is really valuable for understanding how rendering works in Flash.

Since Shape draws vector graphics, I would imagine that what happens when you call drawCircle() is pretty much what is explained in the video.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top