# Holding space, increase variable?

**URL:** <https://forum.kirupa.com/t/holding-space-increase-variable/169880>\
**Category:** Uncategorized\
**Created:** [November 20, 2005, 7:53pm UTC](https://forum.kirupa.com/t/holding-space-increase-variable/169880 "2005-11-20T19:53:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErikHK](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@ErikHK](https://forum.kirupa.com/u/ErikHK)\
**Post date:** [November 20, 2005, 7:53pm UTC](https://forum.kirupa.com/t/holding-space-increase-variable/169880/1 "2005-11-20T19:53:13Z")

</div>

right now, my code looks like this:

```auto

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 🙂

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