Error 1125: ??? Index out of range.

hey Guys. First post here.

I'm having some trouble with my code... I followed Todd's tutorials and got an issue of IndexOutOfRange. :S

here's my code... any ideas?

Code:

package 
{
   import Box2D.Collision.Shapes.b2PolygonShape;
   import Box2D.Common.Math.b2Vec2;
   import Box2D.Dynamics.b2Body;
   import Box2D.Dynamics.b2BodyDef;
   import Box2D.Dynamics.b2FixtureDef;
   import flash.display.DisplayObjectContainer;
   import flash.display.MovieClip;
   import flash.geom.Point;
   
   public class Crate extends Actor
   {
      
      private var _fallingCrateBody:b2Body;
      
      public function Crate(parent: DisplayObjectContainer,location:Point,initVel:Point)
      {
         // 1. Creamos el aspecto físico.
         var movie:MovieClip = new MC_Box_Suelo();
         parent.addChild(movie);
         
         // 2. Creamos la definición de forma.
         var fallingCrateShapeDefinition:b2PolygonShape = new b2PolygonShape();
         trace(1);
         var fallingCrateFixtureDef:b2FixtureDef= new b2FixtureDef();// sus características
         trace(2);
         
            // Propiedades básicas y ESCENCIALES
            fallingCrateFixtureDef.shape = fallingCrateShapeDefinition; // Siempre se le debe asignar una SHAPE
            fallingCrateFixtureDef.friction = 0.8;
            fallingCrateFixtureDef.restitution = 0.3;
            fallingCrateFixtureDef.density = 2;
            
         trace(3);
         // 3. Creamos la definición de cuerpo.
         var fallingCrateBodyDef:b2BodyDef = new b2BodyDef();
         fallingCrateBodyDef.position.Set(location.x / Constantes.RATIO, location.y / Constantes.RATIO);
         fallingCrateBodyDef.angle = 60 * Math.PI/180;
         fallingCrateBodyDef.type = b2Body.b2_dynamicBody;/* Infaltable!!! Esta línea determina si el objeto
                                                es dinámico o no, es decir, si debe ser simulado
                                                o no.   */
         fallingCrateBodyDef.userData = movie;
         fallingCrateBodyDef.userData.width = movie.width;
         fallingCrateBodyDef.userData.height = movie.height;
         //addChild(fallingCrateBodyDef.userData);
         
         // 4. Creamos el cuerpo.
         _fallingCrateBody = Constantes._world.CreateBody(fallingCrateBodyDef);
         
         trace(4);
         // 5. Creamos la forma.
         _fallingCrateBody.CreateFixture(fallingCrateFixtureDef);
         trace(5);
         _fallingCrateBody.ResetMassData();
         
         // 6. Ajustamos posición y velocidad.
         var velocityVector:b2Vec2 = new b2Vec2(initVel.x / Constantes.RATIO, initVel.y / Constantes.RATIO);
         _fallingCrateBody.SetLinearVelocity(velocityVector);
         
         super(_fallingCrateBody, movie);
         
         
         trace("Mi mundo tiene "+Constantes._world.GetBodyCount()+" objetos en el.");
      }
      
   }

}


Thanks in advance.
Here's the error:
Quote:
RangeError: Error #1125: The index 0 is out of the range 0.
at Box2D.Collision.Shapes::b2PolygonShape/ComputeAABB()
at Box2D.Dynamics::b2Fixture/http://www.box2d.org/ns/b2internal::CreateProxy()
at Box2D.Dynamics::b2Body/CreateFixture()
at Crate()
at DemoPhysicsTutorial_02/addCrate()
at DemoPhysicsTutorial_02()


Btw: I was working on the actor class tutorials.
You haven't set any points in your polygon. Must be missing a line, if this is cribbed from a tutorial
Thanks!!

That was very stupid of me!

hehe, but thanks!

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