I use the following function to move a mc to a certain y position. When that y position is reached the mc goes back to it’s original position:
function moveInOut (clip, yPos, speed){
var yStart = clip._y ;
var yTarget = yPos;
clip.onEnterFrame = function (){
var dY= yTarget - this._y;
this._y += dY / speed;
if (Math.abs(dY) < 2){
if (yTarget == yPos) {
yTarget = yStart ;
}
else {
this._y = yStart;
delete this.onEnterFrame;
}
}
};
} ;
and on the button:
on (release) {
moveInOut (menu, 200, 10)
}
But I don’t want the mc going back to it’s original position but to a completely different y position to create kind of a bounce effect
Has anybody an idea how to accomplish that?
Thanks in advance