I've got a revolute joint set up between 2 bodies, and my goal is to make the joint break if too much force acts on it. It seems I could use GetReactionForce to do this, so I gave my joint an instance name, 'armjoint' - when I do this and then compile my project, it throws the error "\BlankProject\..\wck\World.as, Line 4 1000: Ambiguous reference to Joint".
When I give regular body movieclips instance names I can access their Box2D respective class properties such as 'active' etc, but I can't seem to do the same on joints. Does anybody have experience with this? Is it impossible to access certain joint properties that aren't directly on the WCK component properties without creating a class specific to the component?
I have removed joints successfully with Util.remove(jointName). If you are adding the joint to another container than Util.remove(containerName.jointName).
Without seeing your project, my only guess at this point would be that you may not be referring properly to the joint.
Update:
I just remembered that "containerName" was actually a custom class in my project and I did create the "jointName" property in "containerName". So that may not be the issue.
So, how are you creating/adding the joint?
I can't seem to be able to open the .fla file. Probably my Flash is an earlier version.
I did create a test project as you described and was able to remove a joint with a specific instance name. Not sure what could be the issue.
Someone may have a suggestion but in the mean time try to create a joint with code and see if that works.
I seem to be getting some other errors that my be due to paths or maybe to CS4 conversion
I did notice a few things that may be related to the issue:
-Joints have to connect two objects. You only seem to have one circle
-I thought that the main class has to also extend WCK e.g. see Demo.as in the WCK demo
-Might not be an issue but instead of using World as the class name, it is better to use something unique e.g. myWorld.
Hm, joints must connect 2 objects? It seemed perfectly valid to have a joint between an object and the stage behind it, even the WCK demos make use of it - is there an alternate method I should be using? In any case, the final situation for where I'll use these joints is between 2 objects anyway, was just for the sake of example.
As far as I know about extending WCK, that's only for the use of the "b2Base.initialize(); Input.initialize(stage);" lines, which I have on the stage. So it's compiling and detecting that part fine, the only issue seems joint-specific. I think World.as is used internally by WCK anyway so I'm not sure if changing the filename of it would work.
Man! This is a weird issue. Would it be possible to see an example of a working joint that's removable through its instance name? Just so I can compare.