Okay, so I have a movieclip of a letter (done in photshop to look like jelly). I want to animate it to fall from above, bounce on an invisiable plane, squash when it hits, and squash and go back up and decrease it each time until it comes a rest.
I have the bounce but I need to squash.
Code
onClipEvent(load){
var vel:Object = { x: 0, y: 0 };
var pos:Object = { x: _x, y: _y};
var old:Object = { x: _x, y: _y};
var radius:Number = this._width / 2;
var movie:Object = {width: 750, height: 117};
var dragging: Boolean = false;
}
onClipEvent(enterFrame) {
vel.y += _root.gravity;
pos.x += vel.x;
pos.y += vel.y;
// Now update the ACTUAL postion of the movie clip
_x = post.x;
_y = pos.y;
// Has the ball left the bottom of the stage?...
if( pos.y + radius > movie.height ) {
pos.y = movie.height - radius;
vel.y *= -_root.restitution;
}
}