Flex compile errors

Hey guys, I am trying to start experimenting with Flex 2 and Box2D, but I can't even build a simple example. I am using this code:

Code:
var worldAABB:b2AABB = new b2AABB();
worldAABB.minVertex.Set(-320.0, -240.0);
worldAABB.maxVertex.Set(320.0, 240.0);

var gravity:b2Vec2 = new b2Vec2(0.0, 9.8);
var doSleep:Boolean = true;

world = new b2World(worldAABB, gravity, doSleep);

var wallSd:b2BoxDef = new b2BoxDef();
var wallBd:b2BodyDef = new b2BodyDef();
wallBd.AddShape(wallSd);

wallSd.extents.Set(400, 50);
wallSd.position.Set(-320.0, 100);
world.CreatBody(wallBd);


But this gives me the error:

Code:
test.as(42): col: 9 Error: Access of possibly undefined property position through a reference with static type Box2D.Collision.Shapes:b2BoxDef.

   wallSd.position.Set(-320.0, 100);
          ^

test.as(43): col: 8 Error: Call to a possibly undefined method CreatBody through a reference with static type Box2D.Dynamics:b2World.

   world.CreatBody(wallBd);
         ^


The explanation of this error in the docs is that those methods and properties aren't declared in the class, but they clearly are. Another explanation is that they share their name with a pre-existing property or method in a flash api component, but I don't see how there could be any ambiguity there in this case.

Any thoughts?
Hi Mr. E. Mann,

Your first error is because b2BoxDef doesn't have the property 'position', b2BodyDef does however, so try replacing 'wallSd' with 'wallBd'.

The second error is a simple typo, 'CreatBody' should be 'CreateBody'.

Hope that helps,
-Matt
Argh, it's too late to be learning a new API. I can't believe I missed that.

At any rate, thank you very much for your help, it cleared up the problem quite nicely.

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