issue to access a MovieClip

Hi,

I m having an issue to access a MovieClip and execute the command gotoAndStop(2) on the MC created.

I create an instance of the movie clip, but can't figure out how to move its state to another frame.

Here is the code. from the class "mike", see the last lines:

Code:

var bodyKid:b2Body;
            var bodyDefKid:b2BodyDef;
            var boxDefKid:b2CircleDef;
            bodyDefKid = new b2BodyDef();
            bodyDefKid.position.x = Math.random() + 15;
            bodyDefKid.position.y = Math.random() + 10;
            var crate_widthKid:Number = 0.4;
            var crate_heightKid:Number = 0.4;

            boxDefKid = new b2CircleDef();
            boxDefKid.radius = 0.4;
            boxDefKid.density = 0.5;
            boxDefKid.friction = 0.5;
            boxDefKid.restitution = 0.45;

            var kid_mc:MovieClip = new kid();
            bodyDefKid.userData = kid_mc;
            bodyDefKid.userData.width = crate_widthKid * 2 * pixels_in_a_meter;
            bodyDefKid.userData.height = crate_heightKid * 2* pixels_in_a_meter;
            bodyDefKid.userData.name = "Kid";

            kid_mc.bodyKid = m_world.CreateBody(bodyDefKid);
            kid_mc.bodyKid.CreateShape(boxDefKid);
            kid_mc.bodyKid.SetMassFromShapes();
            addChild(kid_mc);
            
// this is where it doesn't work:
kid_mc.gotoAndStop(2);




TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mike/Update()

Anyone has an idea?

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