Slinky Effect in Actionscript

Hi there,

I’m trying to simulate the effect of a slinky spring in actionscript, and I’ve come up against an interesting anomaly.

The code is fairly basic, and takes advantage of a certain degree of latency in the running of the code. The code basically asks all the movie clips to the right of clip that is being dragged, to keep a certain amount of pixels apart from its neighbour. You would think that this would mean the clips would be kept in rigid alignment, but instead you get a great rippling effect.

My problem is that this only seems to work in one direction despite my code being identical (but reversed)for each different case - left and right.

If you take a look at the fla you’ll see what I mean. Try dragging line No. 0 around versus dragging line No. 19.

Any help would be greatly appreciated, or if you know of another way of achieving this that would be great too.

Thanks!