The Box2D example compiles a SWC of the Box2D library using SWIG, then compiles two SWFs that use that library. I looked at the source code for these SWFs and can see & understand how they're interfacing with Box2D, but when I try to use the Box2D SWC library in another project it just fails.
I've got a project in Flash professional that includes the Box2D SWC library. I've got this simple code to test if it's working:
CModule.startAsync();
var g:b2Vec2 = b2Vec2.create();
g.x = 0;
g.y = -10;
trace(g);
When I call b2Vec2.create(), the flash player instantly uses up a ton of memory and hangs until the max script execution time is hit and the player quits. The weird thing is if I do something like this:
trace(Box2D.b2_dynamicBody);
trace(Box2D.b2_staticBody);
It works just fine! The correct values are output. So what am I doing wrong? As far as I can tell I'm doing exactly the same thing the example SWFs are doing, just in Flash Professional.
Thanks.