# Help with jumping animation

**URL:** https://forum.kirupa.com/t/help-with-jumping-animation/309452
**Category:** Uncategorized
**Created:** [May 15, 2010, 3:03pm UTC](https://forum.kirupa.com/t/help-with-jumping-animation/309452 "2010-05-15T15:03:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dman32791](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dman32791](https://forum.kirupa.com/u/dman32791)
#### Post date: [May 15, 2010, 3:03pm UTC](https://forum.kirupa.com/t/help-with-jumping-animation/309452/1 "2010-05-15T15:03:36Z")

</div>

hey everyone i need some help from anybody you who can.

this is my main timeline code:

hero.gotoAndStop(‘still’);

var Key:KeyObject = new KeyObject(stage);

var dy:Number=0;

var gravity:Number=1;

var canjump:Boolean = false;

stage.addEventListener(Event.ENTER\_FRAME,onenter);

function onenter(e:Event):void{

```
dy+=gravity;

if(hero.y&gt;300){
	
	dy=0;
	canjump=true;
	
	}
	
	if(Key.isDown(Key.UP) && canjump){
		
		dy=-10;
		canjump=false;
		
		
		}
		
	hero.y+=dy;

if (Key.isDown(Key.RIGHT)){
	hero.gotoAndStop('walking');
	hero.x+=10;
	hero.scaleX=1;
}else if (Key.isDown(Key.LEFT)){
	hero.gotoAndStop('walking');
	hero.x-=10;
	hero.scaleX=-1;
	}else{
		hero.gotoAndStop('still');
	}

```

}

and i want to figure out how to get a different pose when he is jumping or in the air. i know how to get different poses when i press the left or right key but not when he is jumping. any help would be awesome.
