I have this rather cool code for a _mc on a slope. The only problem I am having is making the sprite.mc change states/animation when the sprite.mc is jumping. Can you help? duh...

here's the code I have:

onClipEvent(load){
speed = 5;
gravity = 0;
r = _height/2; //radius
jumping = false;
jumpingheight = 15;
}

onClipEvent(enterFrame){

if(key.isDown(key.RIGHT)){
_x + =speed;
}
if(key.isDown(key.LEFT)){
_x - =speed;
}


if(key.isDown(key.UP) &&! jumping){
jumping = true;
gravity = -jumpheight;
}

if(!_root.ground.hitTest(_x,_y, true)){
gravity++;
_y+ = gravity;

}else{
jumping =false;
gravity = 0;

}
while(_root.ground.hitTest(_x,_y-1+r,true)){
jumping = false;
_y--;
}
}