This movie uses the sin function to make a ball bounce
Experiment: can you make the ball go from side to side instead of up and down? Can you make it move across the stage as it bounces?
//variables
var angle:Number=0;
var distance:Number=50;
var origY:Number=ball.y;
var rate:Number=0.5;
//initialize
this.addEventListener(Event.ENTER_FRAME,frames);
//functions
function frames(e:Event):void {
ball.y=origY+Math.sin(angle)*distance;
angle=angle+rate;
}//frames