Hello Friends,

I wonder if someone might be able to spot what I am doing wrong in my code.
I am trying to follow and create a tutorial which explains how to make a bouncing ball.

I am really struggling with the Action Script 3.0 even though the teacher types it in.
I am inserting the code so that you can view it.

Many thanks in advance if anyone has an idea where I might be going wrong.
I am very grateful for any and all advice.

The tutorial is located:
http://www.youtube.com/watch?v=36BIN9OKNf8

My code is:

var gravity:Number = 3
var speed:Number = 0
var position:Number
var num:Number =350

addEventListener (Event.ENTER_FRAME, animation)
function animation(e:Event) : void {
speed+=gravity
position = ball.y+speed
if (position>num) (
ball.y = num
);speed = - speed=0.8;
} else {
ball.y += speed;
}