AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos

I noticed a problem with tweened objects, such as a tweened box.
If i create tween symbols containing physical objects in my world, the physical model is lacking behind the visual object. Its movement is scaled differently, it travels roughly 1/3rd of the distance of the visual object.
This also happens when i place symbols from the demo project into my world. Could this be caused because my world has a different scale setting in the init?
Frnk: Could be. Check out line 1176 of BodyShape.as:
Code:
/// I'm really not sure why 0.05 / 20 are the magic numbers here, but they work perfect.
var lv:V2 = new V2(p2.x - lastP.x, p2.y - lastP.y).divideN(world.scale * 0.05);

Tweaking that line you should be able to get things to sync up better.
thx, i will need to do some tweaking then


I have added a doubleClick functionality to Input.as

Code:
s.addEventListener(MouseEvent.DOUBLE_CLICK, handleDoubleClick, false, 0, true);

...
      public static function handleDoubleClick(e:MouseEvent):void   {         
         mouseDoubleClick = true;
         handleMouseEvent(e);
      }




I am accessing Input.as in my player class

Code:
var mouseDouble:Boolean = Input.mouseDoubleClick;
if (mouseDouble) onDoubleClick();  // double click pressed


However it can only register a doubleclick if there is no wck object in the way. As soon as the mouse is over a scaling bg image or a physical object, the doubleclick event isnt called. What could this be ?
I'm simply trying to change the x and y position of some of the objects in the world. But once I apply the new value the object it goes back to it's previous position after one frame.

So does anyone know how to dynamically change the x and y value of an object on run-time?
piers: If you are manually going to set x and y, set the body type to "Animated". If you still want the body to react to collisions though, you'll have to leave the type "Dynamic" and apply forces / impulses to move the body.
@piers to elaborate on mayobutters answer, i believe you can also set Position and/or XForm of the body.

the reason x and y snap back, is because your movieclip is being told to follow the physics body. x and y are some of the properties that are updated each frame to keep following the physics body... so in order to make the change correctly, you must move the physics body, not the movie clip.
Hey guys. Thanks for the answers. I made the body moving by attaching it to an animated object with a rope. I can move the body freely around by adjusting the x and y position of the animated object.

Accessing the body directly would be more ideal though. How do I access the physics body, mr sketchbookgames?
Hi, I've been using the Alchemy port (Box2DAS/Box2D.swc) for a while now with no problems. I just now updated to the latest version of that source, and I immediately get this assertion error:

Code:
Assertion failed: (b1->m_invI > 0.0f || b2->m_invI > 0.0f), function InitVelocityConstraints, file ../Box2D/Dynamics/Joints/b2RevoluteJoint.cpp, line 73.


Anyone know what this means?
Is it a good idea to implement right-click in flash / wck ?
http://www.uza.lt/rightclick/

I am trying to switch to pure mouse controls without keyboard, and a right-click would help, in addition to the double-click that i couldnt get to work yet.
helios02: Some context? What it going on when you get that error?

piers: b2body is a property of all BodyShapes. This is how you access the physics body.

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