Trying to create sliding beads like an abacus

I have 10 beads on a line, each of the beads is twenty pixels wide (total bead width = 200) and the line they are on is 400 wide so there’s plenty of sliding area… I am trying to learn a way so that you can click on any of the beads and slide it left/right along the line and it will push any beads it encounters along as well, and they all will stop once the rightmost/leftmost bead reaches the wall.

I find it’s really helpful if you just imagine an abacus and sliding beads along it.

Any ideas on the best way to go about doing this? I have the actual sliding of individual beads done just fine using startdrag and a rect parameter but can’t figure out how to have the sliding affect the other beads.