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:
But this gives me the error:
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?
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);
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);
^
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?