an ik rig might work for what you are asking. dan ebberts's has a good tutorial/writeup about how to set that up using expressions in after effects:
http://www.motionscript.com/design-guide/ik.html
if you are using creative cloud 2014, you can use the new sourceRectAtTime() function with shape layers to create something similar, but you would need to control it with the rotation property of one of the shape layers, rather than the position of an end point. setting that up is pretty straight forward...
select the shape tool and set it to rectangular and create the first hinge panel by drawing a skinny vertical rectangle. to make things a little more simple, twirl down the layer properties to contents>rectangle 1>transform:rectangle 1>position and set it to 0,0 to center it on the screen (**important, you want to use the contents>rectangle>transform position not the layer>transform properties).
now duplicate the shape layer and move the duplicate bellow the first shape layer and add the following expressions to that she layer:
expression for layer>contents>rectangle 1>transform:rectangle 1>position:
target = thisComp.layer(index-1);
rTarget = target.sourceRectAtTime(t = time, includeExtents = false);
r = sourceRectAtTime(t = time, includeExtents = false);
value + [r.width/2 + rTarget.width/2 + target.content("Rectangle 1").transform.position[0], 0]
expression for layer>contents>rectangle 1>transform:rectangle 1>rotation
target = thisComp.layer(index-1);
-target.content("Rectangle 1").transform.rotation
if you adjust the first shape layer's contents>rectangle 1>transform:rectangle 1>rotation property (**again not the layer>transform>rotation property), the second layer should hinge outward like it is connected to the first.
at this point i'd parent the second shape layer to the first (it will make it easier to move them around). and then you can simply duplicate the second shape layer for as many hinged panels as you need and they should expand and contract like an accordion as you change that tranform:rectangle 1>rotation property of the first layer.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW