Problem with a sliding tab menu

Hi all,
I’m working on a sliding tab menu using tweens, tab menu is vertical, and I don’t find the solution to move tabs together. I can move the tabs with onRollOver and RollOut, but I would like to ad a push or pull effect when a tab pass over another tab. However if it’s not so clear I joined the FLA and SWF files.

This is the code :

import mx.transitions.*;
import mx.transitions.easing.*;
import com.timwalling.TweenDelay;
onEnterFrame = function () {
 for (i=1; i<5; i++) {
  var temp = this["menu"+i];
  temp.begin = temp._x;
  temp.end = temp._x-60;
  temp.time = 50;
  //this["menu"+i].id = i;
  if (temp._x>500) {
   temp.onRollOver = function() {
    easeExpand(this);
   };
   temp.onRollOut = function() {
    easeContract(this);
   };
  } else {
   temp.onRollOver = function() {
    easeUp(this);
   };
   temp.onRollOut = function() {
    easeDown(this);
   };
  }
 }
 function easeUp(what) {
  var tw1 = new mx.transitions.Tween(what, "_x", mx.transitions.easing.Bounce.easeOut, 550, 490, 50);
 }
 // End of the function
 function easeDown(what) {
  //var tw1 = what._y;
  var tw2 = new mx.transitions.Tween(what, "_x", mx.transitions.easing.Elastic.easeOut, 490, 550, 50);
 }
 // End of the function
 function easeExpand(what) {
  var tw3 = new mx.transitions.Tween(what, "_x", mx.transitions.easing.Elastic.easeOut, what.begin, what.end, what.time);
 }
 function easeContract(what) {
  var begin = what._x;
  var tw4 = new mx.transitions.Tween(what, "_x", mx.transitions.easing.Elastic.easeOut, what.begin, what.end, what.time);
 }
};

I’m sure that the code could me more optimised…
Thanks for your help.

any ideas !?
Maybe I was not so clear !

Now i’m trying tu use a prototypes for the tween and if statements for the interactions between tabs.

So now,
tabs works but I don’t find the solution, to move tabs dynamically when a tab cover another tab. If I RollOver a tab, the other tabs need to move together to stay always visible.
here is the new file.

and the code :


import mx.transitions.Tween;
import mx.transitions.easing.*;
navText_array = new Array("PORTFOLIO", "PORTFOLIO", "VENDRE", "STIMULER", "AGENCE");
setUpTabs();
function setUpTabs() {
 var tabTxt = navText_array.length;
 for (i=0; i<tabTxt; i++) {
  var temp = this["menu"+i];
  temp.navText.text = navText_array*;
  temp.begintabUp = temp._x;
  temp.endtabUp = temp._x-60;
  temp.time = 0.60000;
  temp.onRollOver = function() {
   grow(this);
  };
  temp.onRollOut = function() {
   shrink(this);
  };
 }
}
function grow(who) {
 var tabUp:Tween = new Tween(who, "_x", Elastic.easeOut, who.begintabUp, who.endtabUp, who.time, true);
}
function shrink(who) {
 var tabDown:Tween = new Tween(who, "_x", Elastic.easeOut, who.endtabUp, who.begintabUp, who.time, true);
}


Thanks for your help.