Two Things

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:


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