Help with scoring code

I just downloaded a component for my game. IT’s a keep up teh ball game by rolling over it game. I want it so that the number of times you kept it up till it fell to the ground gets squared and added to teh total score. This is the codes i have (seperated into 4 frames). By the way, I use flahs mx.

#1
g = 80;
kicked = 0;
elastic = 0.8;
score = 0;
bestscore = 0;
BallRadius = Ball._height/1;

#2
t = Number(t)+.1;
oldx = x;
oldy = y;
x = getProperty(“Ball”, _x);
y = getProperty(“Ball”, _y);
vy = Number(vy)+Number((g/10));
x = Number(x)+Number((vx/10));
y = Number(y)+Number((vy/10));
if (Number(y)<Number(BallRadius)) {
y = BallRadius;
vx = (vxelastic);
vy = -(vy
elastic);
}
if (Number(y)>Number((300-BallRadius))) {
if (Number(kicked) == 1) {
kicked = 0;
if (Number(score)>Number(bestscore)) {
bestscore = score;
…/score/:my_score = bestscore;
}
lastscore = score;
score = 0;
}
y = 300-BallRadius;
vx = (vxelastic);
vy = -(vy
elastic);
}
if (Number(x)<Number(BallRadius)) {
x = BallRadius;
vx = -(vxelastic);
vy = (vy
elastic);
}
if (Number(x)>Number((400-BallRadius))) {
x = 400-BallRadius;
vx = -(vxelastic);
vy = (vy
elastic);
}
setProperty(“Ball”, _x, x);
setProperty(“Ball”, _y, y);
setProperty(“Ball”, _rotation, x);
setProperty(“Ball”, _xscale, 25);
setProperty(“Ball”, _yscale, 25);

#3
gotoAndPlay(“LoopStart”);

#4
kicked = 1;
t = Number(t)+.1;
oldx = x;
oldy = y;
x = getProperty(“Ball”, _x);
y = getProperty(“Ball”, _y);
vx = Number((getProperty(“Ball”, _x)-getProperty(“mouse”, _x))10)+Number(((random(3)/10)-0.15));
vy = Number(-125)+Number((y-getProperty(“mouse”, _y)));
dx = (getProperty(“Ball”, _x)-getProperty(“mouse”, _x));
if (Number(dx)>0) {
vy = Number(vy)+Number(dx);
} else if (Number(dx)<0) {
vy = vy-dx;
}
if (Number(y)<Number(BallRadius)) {
y = BallRadius;
vx = (vx
elastic);
vy = -(vyelastic);
}
if (Number(y)>Number((300-BallRadius))) {
if (Number(score)>Number(bestscore)) {
bestscore = score;
}
score = 0;
y = 300-BallRadius;
vx = (vx
elastic);
vy = -(vyelastic);
}
if (Number(x)<Number(BallRadius)) {
x = BallRadius;
vx = -(vx
elastic);
vy = (vyelastic);
}
if (Number(x)>Number((400-BallRadius))) {
x = 400-BallRadius;
vx = -(vx
elastic);
vy = (vy*elastic);
}
setProperty(“Ball”, _x, x);
setProperty(“Ball”, _y, y);
setProperty(“Ball”, _rotation, x);
setProperty(“Ball”, _xscale, 25);
setProperty(“Ball”, _yscale, 25);
gotoAndPlay(“LoopStart”);

If you can help, thansk alot.
-aussy