Very Odd Glitch

I'm making a shape creation tool in flash. I'll post it when I'm done, but I it seems that I can only create shapes if I do it clockwise. I don't recall reading anything about this in the documentation... It doesnt seem to make very much sence? Has anyone else noticed this.

e.g. This works

shapeDefSW.vertexCount = 3;
shapeDefSW.vertices[0].Set(-49, 23);
shapeDefSW.vertices[1].Set(2, -54);
shapeDefSW.vertices[2].Set(45, 26);

but this doesn't (the same points just in a different order)

shapeDefSW.vertexCount = 3;
shapeDefSW.vertices[0].Set(-49, 23);
shapeDefSW.vertices[1].Set(45, 26);
shapeDefSW.vertices[2].Set(2, -54);
This is expected behaviour - Box2d can only handle counterclockwise polygons (yours is ccw if you use a coordinate system with y pointing up) because orientation is one of the assumptions it makes when checking for convexity and overlap. It's a fairly simple task to check this before you pass in a polygon, do a google search for polygon orientation and you'll find a lot of explanations. Also, the code to check for this should be somewhere within the Box2dAS3 code.

Original thread: https://box2d.org/forum/viewtopic.php?t=382