Claus Wahlers has a great post on some lower level Flash handling for shapes. He posts about a tool called as3swf which helps to look into the raw shapes and vector drawing calls in the flash engine.
The output of this tool gives the raw machine code/assembly like procedural output that is very similar to other rendering engines. It actually makes me think of OpenGL a bit in the output switch based, procedural flow except this if for vector drawing rather than raster.
Sample output
[83:DefineShape4] ID: 1 FillStyles: [1] [SWFFillStyle] Type: 0 (solid), Color: 666666 LineStyles: [1] [SWFLineStyle2] Width: 200, Color: ff0000 ShapeRecords: [SWFShapeRecordStyleChange] MoveTo: 400,400, FillStyle1: 1, LineStyle: 1 [SWFShapeRecordStraightEdge] Horizontal: 2000 [SWFShapeRecordStraightEdge] Vertical: 2000 [SWFShapeRecordStraightEdge] Horizontal: -2000 [SWFShapeRecordStraightEdge] Vertical: -2000 [SWFShapeRecordEnd]
It is always good to know what is going on in lower levels to better code for projects that perform well. Another great post on this is the Elastic Racetrack of the AS3 and AVM2 virtual machine which describes how the AVM2 handles drawing those low level shape calls in addition to handling script.
- as3swf at github
- post on the tool and more information on shapes in flash at a low level
- ‘Elastic Racetrack’ for Flash 9 and AVM2 another lower level article how the flash player draws at runtime