# Seperate Actions for Character Facing Direction

**URL:** <https://forum.kirupa.com/t/seperate-actions-for-character-facing-direction/318200>\
**Category:** flash\
**Created:** [January 12, 2011, 10:54pm UTC](https://forum.kirupa.com/t/seperate-actions-for-character-facing-direction/318200 "2011-01-12T22:54:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MLGlololol](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@MLGlololol](https://forum.kirupa.com/u/MLGlololol)\
**Post date:** [January 12, 2011, 10:54pm UTC](https://forum.kirupa.com/t/seperate-actions-for-character-facing-direction/318200/1 "2011-01-12T22:54:42Z")

</div>

Okay, I’m new to forums, as a whole, so sorry if I do something ‘wrong’…  
Anyway, for a school assignment, I want to have a one of my characters walk around the screen… with the watcher controlling him… and I want him to roll (just for fun) whenever one presses space. My code plays, but I want to have him roll in the direction he’s facing. I don’t know how to make it like… ifLeftKey is down, play the left roll.  
Anyway, here’s what I’ve got so far:  
onClipEvent(enterFrame){  
if(Key.isDown(Key.RIGHT)){  
this.\_x += 5;  
this.gotoAndStop(“right”);  
}  
if(Key.isDown(Key.LEFT)){  
this.\_x -= 5;  
this.gotoAndStop(“left”);  
}  
if(Key.isDown(Key.UP)){  
this.\_y -= 5;  
this.gotoAndStop(“up”);  
}  
if(Key.isDown(Key.DOWN)){  
this.\_y += 5;  
this.gotoAndStop(“down”);  
}  
if(Key.isDown(Key.SPACE)) {  
this.gotoAndPlay(“roll”);  
}  
}

(Hopefully I got what I want across… sorry if I didn’t, I guess, tell me to explain more and I’ll look for an edit button?)
