I have three prims, we'll call them Rod, Ball, and Socket.
The root prim at rez is always the Ball. Doesn't matter really, but it gives us a starting point.
I made it so that you can touch either the Ball or Socket to make it become the root prim. So, if the Ball is the current root prim, and I want the Socket to be the root, I just touch the Socket and viola! It works both ways.
I perform the swap, by calling llBreakAllLinks() and then re-linking the Ball and Socket via the Rod script with llCreakLink(key,FALSE), the last one becomes the root. I then actually swap the key variables. Also, I am using llPassTouches(FALSE); in the Ball and Socket prims to prevent either from passing the touch event to the other.
CODE
SwapRootPrims()
{
//Break ALL Links
llBreakAllLinks();
//Re-Link old Root_Anchor as Child
llCreateLink(Root_Anchor,FALSE);
//Re-Link old Child_Anchor as Root
llCreateLink(Child_Anchor,FALSE);
//Swap keys
Temp_Anchor = Root_Anchor;
Root_Anchor = Child_Anchor;
Child_Anchor = Temp_Anchor;
//Shows only 2 prims after clicking without the radial
//Clicking the old root to swap again raises the error
//and it is no longer linked to the set
llSetText((string)llGetNumberOfPrims(),<255,255,255>,1.0);
}
The Bug:
When I use the radial, no problems. I can swap between the two objects all day, and it works fine. It's only when I actually touch the Ball or Socket, without using the radial, is when I start having problems.
When I touch the child prim once, say the Ball, it does in fact become the root. However, the old root, in this case the Socket doesn't re-link. And when I click on it, this time with either the radial, or by touching, I get an error...
"0 someone else is grabbing that object"
I only get the error once. However, clicking it again does me no good since it is no longer part of the set.
I would think it was my code if it happened both when using the radial or by touching. But I believe there is an problem somewhere else. I certainly hope it's only my code and that it can be quickly explained away, with a solution of course.
EDIT: Oh, and I'm using llMessageLinked() to tell the Rod that it needs to swap the roots.
Thanks.

But no, I have not. I'll give it a few days to get a solid answer. For now I'll just use the radial to fire the touch event.