I looked at the phystest.swf that came with box2d. I then tried to build it, but I had errors in input.as with functions that didn't return types. I put void for all these functions except isKeyInBuffer, which I defined as Boolean. It compiles correctly, but the colors are different and some words are missing. The worst part is none of the objects actually move.
I was planning on compiling HelloWorld and checking it for errors, but it depends on the .fla and I'm using FlashDevelop.
Any ideas what's wrong with it?
Thanks
I use FlashDevelop too.
Those are warnings, not errors, right? Set Project->Properties->BackgroundColour to #000000 for a black background. The missing words are simply white on white. The objects not moving is a little troubling though -- I've never had that problem. Sprinkle some traces in the code and see where it gets to?
EDIT: Are you using the debug Flash Player as recommended by FlashDevelop's install instructions? It pops up error windows if something goes wrong. I think the regular Flash Player just silently ignores errors.
Yeah, they came up as warnings, but they caused the build to fail, so I just changed them. I guess I'll try it again with the original file and see if I can figure out what is causing the fail.
EDIT: Yeah, I'm using the debug flash player.
I tried it again and it seems that only warnings come up, but the build still fails. Here's the output:
..\FlashDevelop projects\Box2d\src\General\Input.as(77): col: 32 Warning: return value for function 'update' has no type declaration.
static public function update(){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(118): col: 41 Warning: return value for function 'mousePress' has no type declaration.
public function mousePress(e:MouseEvent){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(130): col: 43 Warning: return value for function 'mouseRelease' has no type declaration.
public function mouseRelease(e:MouseEvent){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(140): col: 36 Warning: return value for function 'mouseLeave' has no type declaration.
public function mouseLeave(e:Event){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(150): col: 40 Warning: return value for function 'mouseMove' has no type declaration.
public function mouseMove(e:MouseEvent){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(216): col: 58 Warning: return value for function 'isKeyInBuffer' has no type declaration.
static public function isKeyInBuffer(k:int, i:int, t:int){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(225): col: 42 Warning: return value for function 'keyPress' has no type declaration.
public function keyPress(e:KeyboardEvent){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(240): col: 44 Warning: return value for function 'keyRelease' has no type declaration.
public function keyRelease(e:KeyboardEvent){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(263): col: 29 Warning: return value for function 'fillAscii' has no type declaration.
private function fillAscii(){
^
..\FlashDevelop projects\Box2d\src\General\Input.as(365): col: 21 Warning: variable 'timeSinceLastKey' has no type declaration.
static public var timeSinceLastKey = 0;
^
..\FlashDevelop projects\Box2d\src\TestBed\TestTheoJansen.as(131): col: 57 Warning: return value for function 'CreateLeg' has no type declaration.
private function CreateLeg(s:Number, wheelAnchor:b2Vec2){
^
Build halted with errors (mxmlc).
Done (1)
I don't really understand why the build is failing.
Well, I disabled the warnings, and now everything looks and works like it should except the simulation. Nothing moves at all.
Yup, that was the problem. Works like a charm now. Thanks!
I'm using Flex/mxmlc 3.0. It seems to be a lot pickier than the standard Flash compiler.
Nice! I quickly gave up on testing with Box2D because of this issue. Nice to know what the problem was.