EDIT: The post below is outdated. EdgeShapes are now merged into the main Box2DFlash SVN repository. Get them from there:
http://sourceforge.net/scm/?type=svn&group_id=210232The new EdgeShapes are a direct port of the version I made for C++:
viewtopic.php?f=3&t=1577&hilit=edgeshapesOLD POST:
DEMO!I have (re)implemented shapes composed of infinitely-thin line segments in Box2D. I've decided to call my implementation "Static Edges".
This is a beta. The API is subject to change. A C++ port is possible, eventually, though whether or not it will be integrated into the main branch of Box2D is still uncertain, and this branch will be updated at my whim.

However, I welcome bug reports and feedback.
The way you create Static Edges differs from the norm. You start by creating a definition of a "chain" of connected edges:
Code:
var chainDef: b2StaticEdgeChainDef = new b2StaticEdgeChainDef();
chainDef.vertexCount = 3;
chainDef.vertices.push(new b2Vec2(x1,y1));
chainDef.vertices.push(new b2Vec2(x2,y2));
chainDef.vertices.push(new b2Vec2(x3,y3));
chainDef.isALoop = true; // connect the first and last vertices
Line Segments are only allowed to be static. So you can only attach them to the ground body:
Code:
world.CreateGroundShape(chainDef);
In this example, this one function call will create 3 line segments, each of type "b2StaticEdgeShape", and it will return one object of type "b2StaticEdgeChain".
Static Edges have an "inside" and an "outside". Which is which depends on your coordinate system. If up is positive on the Y axis, floors go from right to left, and ceilings go from left to right. If up is negative, floors go from left to right and ceilings go from right to left. This is consistent with the vertex order of Polygons.
As a bonus, you can find a super-barebones SVG parser in TestBed/TestEdges.as, so that you can draw paths in Inkscape and import them into Box2D. Inkscape was my level editor for Planet of the Forklift Kid.