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.