PDA

Click to See Complete Forum and Search --> : combining deacceleration & elastic movement



Neel
06-16-2002, 04:00 AM
hi,
I have two scripts 4 deacceleration and elastic movement.both r working well induvidually but when i'm combining these 2 for acombining effect so that an object come outside of the stage with a retarded motion and stop with a jerk...
here r my scripts:
retarded motion
onClipEvent (load) {
function deccel (finalX) {
distance = finalX-_x;
_x += distance/4;
}
}
onClipEvent (enterFrame) {
this.deccel(400);
}
jarking:
onClipEvent (load) {
function accel (finalX) {
distance = finalX-_x;
_x += distance-(_x*.4);
}
}
onClipEvent (enterFrame) {
this.accel(400);
}
the problem i'm gettin only the first function is workin if i swap the functionc then the 2nd one is workin