[mx] easing with a little outbounce?

Hi, i put this simple easing code together (below). You can call me i’m being greedy but i’d like to introduce alittle outbounce effect. nothing fancy just one bounce from its final position and then the mc returns to x=500 and y=0.

Is my code below easy to adapt or will i have to start again?

onClipEvent(load){
_x=0;
_y=0;
speed=4;
finalx=500
finaly=0
}

onClipEvent(enterFrame){
_x+=(finalx-_x)/speed;
_y+=(finaly-_y)/speed;
}

any help or advice would be most appreciated.

wilma.

You could add a check that if both x and y are at their final positions and you haven’t jumped yet then jump and set flag saying you have done the jump.

like

add jump = false; line to on load function and add something like this to enterFrame

if((_x>=500 & _y<=0) & jump == false){
// jump
}

Liz

oops, forgot to add setting the flag :slight_smile:

jump = true; inside the if.

Liz

can’t get it to work, but thanks anyway…

i’ll keep going with it.

I put 0.6 in for the speed, it bounces but its not quite the effect i had in mind as it too quick.

cheers