Platform jumping

when i try to make the character jump when he is on the platform it doesnt work.
heres my actionscript

onClipEvent(load) {
speed=7;
jumping=false;
jump=0;
startY=_y;
scrollspeed=7;
fallspeed=5;
}
onClipEvent(enterFrame) {
if (jumping) {
_y += jump;
jump += 1;
if (_y>=startY) {
_y = startY;
jumping = false;
}
}
else {
if (Key.isDown(Key.SPACE)) {
jumping = true;
jump = -15;
speed=7;
}
}
if(Key.isDown(Key.LEFT)) {
_x -= speed;
_root.ground._x+=scrollspeed;
}
if(Key.isDown(Key.RIGHT)) {
_x += speed;
_root.ground._x-=scrollspeed;
}
if(_root.ground.hitTest(this._x, this._y, true)) {
jump=12;
jumping=false;
}
else {

}
}