Beads on a string

I'm using the AS3 port of Box2D and it is great.
I was wandering how I should implement a a joint similar to the pulley joint only it would be more general in the sense the many bodies could be attached to it. I basically need to implement the following case in general:
/o\ /o\
| | | |
| | | |
* \o/ *
|
*
Where * is a body and o is a pulley. The joint's total length should not change but the distance between each pulley or node can - like beads on a string.
I tried thinking of it as a composite pulley or as prismatic joints coupled with a gear joint but those solutions are not possible.

Any ideas?

Thanks
If the pulleys don't move you can do this with multiple pulleys, otherwise you'll need to implement a new joint type (not an easy task).

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