Holding space, increase variable?

right now, my code looks like this:


onClipEvent(load){
speedy = 1.1;
gravity = 9.82;
speedx = 40;
}

onClipEvent(enterFrame){

if(Key.isDown(Key.SPACE)){
speedx *= 1.2;
}

time = getTimer();
time /= 100;
speedy = gravity * time;
this._x += speedx/5;
this._y += speedy/5;

}

What I want is that the flash should wait until I’ve finished pressing space, and the longer I hold in space, the bigger the variable speedx is. I can hold it in right now, but the ball will fall before I’ve released space. I’m really new to this so please be nice :slight_smile:

EDIT: the flash is a ball that “throws”, and the code is on the ball, which is a movie clip.