# Two Things

**URL:** <https://forum.kirupa.com/t/two-things/97823>\
**Category:** Uncategorized\
**Created:** [December 29, 2003, 11:07pm UTC](https://forum.kirupa.com/t/two-things/97823 "2003-12-29T23:07:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![InsaneMonk](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@InsaneMonk](https://forum.kirupa.com/u/InsaneMonk)\
**Post date:** [December 29, 2003, 11:07pm UTC](https://forum.kirupa.com/t/two-things/97823/1 "2003-12-29T23:07:08Z")

</div>

Well, I actually have two things. First, I have an easy method for a jumping system in a flash game. It’s a bit glitchy, but here it is:

```auto

onClipEvent(load) {
       var fallness = 10; } 
onClipEvent(enterFrame){           
       if (!this.hitTest(_root.ground) && !Key.isDown(Key.UP)) {  
             this._y += fallness; 
        } 
         if (Key.isDown(Key.UP)) {
	gravity -= 1;
	this._y -= gravity;
        }
        if (this.hitTest(_root.ground)) {
	gravity = 10; 
          } 
} 
onClipEvent (keyUp) {
       gravity = 10;
}

```

ok so there you can apply your own crap to it. And I have another thing to ask: how would you go by using a switch statement. ive been having trouble with them along with for… in loops
