Objects with relative positions

Couldnt really think of a better title at this moment, so Im sorry if this one sucks in a major way…

I was thinking of a website design where the links (to subpages) are in 5 squares on one horizontal line. If you click one of the squares, it would enlarge and push it’s neighbours away, to fill the stage. Then click somewhere else to have it shrink again and all the boxes would be aligned in the original way.

Now when I tried this in flash I immediatly came to big trouble with boxes flying off the stage, also, another problem is having the growing boxes all fill the same space, I really wouldn’t want to make 5 different tweens, but I don’t know how to gradually make a square grow in ActionScript.

What I tried at first is just work with a tween and a simple actionscript which says (for each separate square) if the square next to you gets larger, make sure your _x changes when it’s _width increments. This resulted in creating all the boxes being accelerated of the stage as soon as I asked one to grow… I can see in the code why it does that, but I can’t figure out what I should change… I tried to work some sort of if(…) statement but Im no good at those, so it didnt work out…

a.onEnterFrame = function(){
	a._x = b._x - b._width
b.onEnterFrame = function(){
	b._x = a._x + a._width
	b._x = c._x - c._width
//etc. until e.onEnterFrame[...]

Any ideas?