Detect if two sensor are overlaped?

Hello, this is my first question, I recently register my account but I've been used wck since a week .

I need to know if two sensors are overlaped, these sensors are part of a BodyShape, actually they are the extremes of a " moving straw", I move each straw until they touch each other, but they only response with the extremes, I'm using the reportBegin and a listener for each "extreme", What I need is to know when they touch each other and the create a joint from extreme to extreme, but when I do that and I compile it, it shows me the next message:

Quote:
Assertion failed: (IsLocked() == false), function CreateJoint, file ../Box2D/Dynamics/b2World.cpp, line 210.

[object AlchemyExit]
at Function/<anonymous>()
at Function/<anonymous>()
at Box2DAS.Dynamics.Joints::b2Joint()
at Box2DAS.Dynamics.Joints::b2DistanceJoint()
at wck::Joint/createDistanceJoint()
at wck::Joint/createJoint()
at wck::Joint/create()
at misc::Entity/ensureCreated()
at misc::Entity/handleAddedToStage()
at flash.display::DisplayObjectContainer/addChild()
at wck::WCK/manejaContacto()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at Box2DAS.Common::b2EventDispatcher/dispatchEvent()
at Box2DAS.Dynamics::b2ContactListener/ContactDispatch()
at Box2DAS.Dynamics::b2ContactListener/BeginContact()
at Box2DAS.Dynamics::b2World/BeginContact()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at global/AS3_CallTS()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at Function/<anonymous>()
at cmodule.Box2D::FSM__ZN13WorldListener12BeginContactEP9b2Contact/work()
at Function/<anonymous>()
at Function/<anonymous>()
at Box2DAS.Dynamics::b2World/HandleStep()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at Box2DAS.Common::b2EventDispatcher/dispatchEvent()
at Box2DAS.Dynamics::b2World/Step()
at wck::World/step()


I don't know if this is caused by the fact that the bodies (straws) are moving right before it creates the joint.
What I'll possibly do is to put the straws in position (with the edges overlaped) and Just After that, trigger the contactListener but I don´t know how can I detect the overlaping of the sensors (edges), Can someone help me please?
Sounds like you might need to do world.doOutsideTimeStep( functionNameToCreateLinks );

If you don't do that, you will be trying to access the physics system when it's locked out. I'm not an expert in Box2D or the Alchemy port, but I'm guessing that in Alchemy there's a place in time where the logic is beyond Flash and inaccessible to it. The outside time step stuff ensures that when the World's step function is called, any items that have registered to do "when the time is right" will then be acted upon.

I had this error all of the time when I first got started using WCK+Alchemy Box2D, so welcome to the club!

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