Prismatic Joint Question

I'm just implementing a Prismatic Joint, and for this example I would really like to be able to create the joint dynamically (which isn't in itself a problem).
The part I'm unable to do is that I would like to activate joint partially 'prismatized' - by this i mean with the body partially along the axis of movement - after this the motor should affect the body in the normal way.
I've not been able to achieve this, but maybe I'm missing something obvious.
Any pointers would be great!
Please answer my questions too.
My code:
Code:
                var bodyDef:b2BodyDef;
               var polygonShape:b2PolygonShape;
                    var fixtureDef:b2FixtureDef;
                    var pjd:b2PrismaticJointDef;

               //box1
               bodyDef = new b2BodyDef();
               bodyDef.position.SetV(new b2Vec2(5.0, 1.0));
               bodyDef.angle = 0.0;
               bodyDef.angularDamping = 0.1;
               bodyDef.linearDamping = 0.1;

               var box1:b2Body = m_world.CreateBody(bodyDef);

               polygonShape = b2PolygonShape.AsBox(0.5,0.5);

               fixtureDef = new b2FixtureDef  ;
               fixtureDef.shape = polygonShape;

               fixtureDef.density = 1.0;
               fixtureDef.friction = 0.25;
               fixtureDef.restitution = 0.0;

               box1.SetType(2);
               box1.CreateFixture(fixtureDef);


               //box2
               bodyDef = new b2BodyDef();
               bodyDef.position.SetV(new b2Vec2(5.0, 3.0));
               bodyDef.angle = 0.0;
               bodyDef.angularDamping = 0.1;
               bodyDef.linearDamping = 0.1;

               var box2:b2Body = m_world.CreateBody(bodyDef);

               polygonShape = b2PolygonShape.AsBox(0.5,0.5);

               fixtureDef = new b2FixtureDef  ;
               fixtureDef.shape = polygonShape;

               fixtureDef.density = 1.0;
               fixtureDef.friction = 0.25;
               fixtureDef.restitution = 0.0;

               box2.SetType(2);
               box2.CreateFixture(fixtureDef);

               //joint
               pjd = new b2PrismaticJointDef();
               pjd.Initialize(box1, box2, box1.GetPosition(), new b2Vec2(0.0, 1.0));
               pjd.maxMotorForce = 80.0;
               pjd.motorSpeed = 10.0;
               pjd.enableMotor = true;


               pjd.lowerTranslation = 0.0;
               pjd.upperTranslation = 1.0;
               pjd.enableLimit = true;

               m_world.CreateJoint(pjd);

Image
It jumping like a spring.
When one of body is ground, all work fine. Also this code work fine in java? What problem with AS3 port?
I was unable to get this working with the prismatic joint - in the end I created a workaround using a distance joint which i manually updated the m_length value. When I got to the correct distance, I destroyed and rebuilt the joint...

Bit ugly, but functional.
wonderful, but it work if density = 5;

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