Flash Help

I am making a game in flash class in which a player can be moved around and can shoot projectiles at other computer characters. I have successfully gotten character to move around using the arrow keys, but I have a few other issues. One, when I move around the character, I am trying to get it to change the sprite so it faces the right direction when the respective key is hit. Also, I need help creating and shooting projectiles. I am using action-script 3. Thank you. 

 

Here is my code: 

<code>

var isRight:Boolean=false
var isLeft:Boolean=false
var isUp:Boolean=false
var isDown:Boolean=false


stage.addEventListener(KeyboardEvent.KEY_DOWN, downKey);
function downKey(event:KeyboardEvent){
if(event.keyCode==39){
isRight=true;
}
if(event.keyCode==37){
isLeft=true;
}
if(event.keyCode==38){
isUp=true;
}
if(event.keyCode==40){
isDown=true;
}
}

stage.addEventListener(KeyboardEvent.KEY_UP, upKey);
function upKey(event:KeyboardEvent){
if(event.keyCode==39){
isRight=false;
}
if(event.keyCode==37){
isLeft=false;
}
if(event.keyCode==38){
isUp=false;
}
if(event.keyCode==40){
isDown=false;
}
}

stage.addEventListener(Event.ENTER_FRAME, loop);
function loop(Event){
if(isRight==true && guy.x<450){
guy.x+=5;
}
if(isLeft==true && guy.x>50){
guy.x-=5;
}
if(isUp==true && guy.y>50){
guy.y-=5;
}
if(isDown==true && guy.y<350){
guy.y+=5;

}
}

</code>