WCK elastic joint. please advise!

Please excuse the double posting kind of, but now I got some code snippets since I can't yet figure this one out:
I got two bodies as seen in the attach picture and my goal is to make the string between them not that stiff, but more to an elastic behavior!

So, this is what I wrote on an ADDED_TO_STAGE event:

Code:
private function addedHandler(event : Event) : void {
         var firstJoint : Object = new Object();
         firstJoint = {name:"j1", alpha:0, x:7.2, y:-76, type:"", fHz:1, dRatio:1.5, cConected:true, skin:"", t2n:"j2"};

         var secondJoint : Object = new Object();
         secondJoint = {name:"j2", alpha:0, x:2.10, y:-23.45, type:"Revolute", fHz:1, dRatio:1.5, cConected:true, skin:"Rope", t2n:"j1"};

         jointMe(firstJoint, secondJoint);
      }



and of course this is the function called to join the two bodies:

Code:
public function jointMe(firstJoint : Object, secondJoint : Object) : void {
         // FirstJoint init:
         var _firstJoint : WCKJoint = new WCKJoint();

         _firstJoint.name = firstJoint["name"];
         _firstJoint.type = firstJoint["type"];
         _firstJoint.frequencyHz = firstJoint["fHz"];
         _firstJoint.dampingRatio = firstJoint["dRatio"];
         _firstJoint.collideConnected = firstJoint["cConected"];
         _firstJoint.connectorClassName = firstJoint["skin"];
         _firstJoint.x = firstJoint["x"];
         _firstJoint.y = firstJoint["y"];
         _firstJoint.target1Name = "";
         _firstJoint.target2Name = firstJoint["t2n"];
         _firstJoint.alpha = firstJoint["alpha"];

         gameJoints[firstJoint["name"]] = _firstJoint;
         this.addChild(_firstJoint);

         // SecondJoint init:
         var _secondJoint : wck.Joint = new WCKJoint();

         _secondJoint.name = secondJoint["name"];
         _secondJoint.type = secondJoint["type"];
         _secondJoint.frequencyHz = secondJoint["fHz"];
         _secondJoint.dampingRatio = secondJoint["dRatio"];
         _secondJoint.collideConnected = secondJoint["cConected"];
         _secondJoint.connectorClassName = secondJoint["skin"];
         _secondJoint.x = secondJoint["x"];
         _secondJoint.y = secondJoint["y"];
         _firstJoint.target1Name = "";
         _secondJoint.target2Name = secondJoint["t2n"];
         _secondJoint.alpha = secondJoint["alpha"];

         gameJoints[secondJoint["name"]] = _secondJoint;
         this.addChild(_secondJoint);
      }



To be mentioned that I am moving the larger body using the arrow keys, around the scene and the small round body bounces below!
Everything works perfectly only that I cannot obtain the elastic string effect and is really driving me nuts :) as it would look much more realistic!
Please, please guys, if you got any kind of suggestions or done something like that in the past, let me know!

Thank you again for your awesome work!
Gamez-Factory
Since you're using WCK, why not use the "spring" feature?

set enableMotor = true
set spring = true
set springConstant = some constant you'll have to tweak
set springDamping = some constant you'll have to tweak

use a prismatic joint with this. Wont work with the distance joint.

Also there's a dedicated WCK forum:

viewforum.php?f=19

EDIT: if don't want the rotation between the two bodies locked, you will need some in-between body hooked up with a revolute joint.
mayobutter wrote:
set enableMotor = true
set spring = true
set springConstant = some constant you'll have to tweak
set springDamping = some constant you'll have to tweak

Thank you again, mayo!
Finally, I found how to set up a spring properly in WCK via AS!!! 😀

I did set spring, springConstant, springDamping but didn't know that have also to set enableMotor.

I was going to ask it before: Is there a "reasonable" WCK documentation or something that comes close that details cases like this (i.e. setting up a "spring") since most of the Box2D code that I saw seem to do things differently.

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