wont run after running function X times

Im experiencing a very strange behaviour. I have this world setup with one ragdoll and a number of thin wide boxes that make up the ground. I have a function that adds the next ground body so that it touches the previous box edge. This needs to be done because their rotation may vary. The problem occurs when i have run this function exactly 5 times (that is, added 5 ground boxes at world startup) - yesterday this number was higher, about 15, but there was still this limit. When i exceed it, my main loop wont run. Everything is added and every line of code is run, according to traces, except the main loop that never starts to run. Compiles fine.

Any ideas on what this might be?

EDIT: turns out its this one that only can be run 5 times
Code:
   
public function addGround(posX:Number, posY:Number, rot:Number = 0):b2Body
      {
         //shape
         var boxDef:b2PolygonDef = new b2PolygonDef();
         boxDef.SetAsBox(10 / 2, 0.4 / 2);
         boxDef.density = 1.0;
         boxDef.friction = 0.1
         boxDef.restitution = 0.2;
      
         //body
         var bodyDef:b2BodyDef = new b2BodyDef();
         bodyDef.position.x = posX
         bodyDef.position.y = posY
         bodyDef.angle = rot / (180/Math.PI)
         bodyDef.userData = new ground_mc()
         bodyDef.userData.name = "ground"
         
         
         //create
         var body:b2Body = m_world.CreateBody(bodyDef);
         body.CreateShape(boxDef);
         layers[0].addChild(bodyDef.userData);
         return body
      
      }
without seeing the rest of the code, a few possibilities...

- all the instance names are the same ('ground') - usually that doesn't matter, but sometimes it does (esp for getChildByName : ).
- there are missing semicolons -- always pays to be paranoid in flash.
- is there an exception? eg is layers[0] null or something? That will cause the timeline to run, but the code to cease.
seems like everything worked when i testet it today, with no changes made. Disturbing

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