# Character movement jumping AS3

**URL:** <https://forum.kirupa.com/t/character-movement-jumping-as3/296772>\
**Category:** Uncategorized\
**Created:** [September 20, 2009, 6:22am UTC](https://forum.kirupa.com/t/character-movement-jumping-as3/296772 "2009-09-20T06:22:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phingko](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@phingko](https://forum.kirupa.com/u/phingko)\
**Post date:** [September 20, 2009, 6:22am UTC](https://forum.kirupa.com/t/character-movement-jumping-as3/296772/1 "2009-09-20T06:22:13Z")

</div>

Hi

I’ve encountered a problem while coding my character to jump in my game. My character just goes up and stayed there and not coming down. I need it to jump up and then come back down when user press the keyboard arrow UP. I’ve define isUp =true when key is pressed and set it back to false when user release key release. I’ve search many tutorials and the codes seems short and simple but I find it quite confusing.

i followed a tutorial, my character will go up but wouldnt come down. Cant figure out what’s wrong with the code. Can anyone help me with this or maybe help point out to me how i should code this please… Thanks~

function onLoop(evt:Event):void  
{  
dy+=gravity;

```
if(ninja_mc.y&lt;400)
{
    dy=0;
    isJumping = true;
}

if(isUp && isJumping)
{
      dy =-10;
      isJumping=false;
        
}
ninja_mc.y +=dy;

```

}
