Hello everyone, im trying to create this custom menu a bit more efficiently. As written, it operates fine glitch free. However, id like to incorporate some easing into the movement of each movie clip.
mc_ddTyp.onPress = function() {
MenuMove(this,-180.0,-80.0);
MenuMove(mc_Typplus,-175.0,-75.0)
MenuMove(mc_Typminus,-175.0,-75.0)
MenuMove(mc_ddSignature,-220.0,-120.0);
MenuMove(mc_searchBtnA,-260.0,-160.0);
fade(mc_ddTypFull);
fade(mc_Typplus);
};
function MenuMove(target, EndLoc, StartLoc) {
if (target._y == StartLoc) {
MoveUp(target,EndLoc);
} else {
MoveDown(target,StartLoc);
}
}
function MoveUp(target, EndLoc) {
target.onEnterFrame = function() {
target._y -= 10;
if (target._y<=EndLoc) {
delete target.onEnterFrame;
}
};
}
function MoveDown(target, StartLoc) {
target.onEnterFrame = function() {
target._y += 10;
if (target._y>=StartLoc) {
delete target.onEnterFrame;
}
};
}
function fade(target) {
if (target._visible == false) {
fadeIn(target);
} else {
(fadeOut(target));
}
}
function fadeIn(target) {
target._visible = true;
target._alpha = 0;
target.onEnterFrame = function() {
target._alpha += 10;
if (target._alpha>=100) {
target._alpha = 100;
delete target.onEnterFrame;
}
};
}
function fadeOut(target) {
target._alpha = 100;
target.onEnterFrame = function() {
target._alpha -= 10;
if (target._alpha<=0) {
target._alpha = 0;
target._visible = false;
delete target.onEnterFrame;
}
};
}
can anyone help me out how to incorporate tween classes and then easing?
thanks a lot