Getting slideshow to advance with onKeyDown

Hi all,
I’ve made a thing that loads pictures from an external folder. I have some buttons to where when you press on one it will go to the next picture and when you press on the other one it will go to the previous picture. However, I cannot make it go to the next or previous images by using the arrow keys. I’ve tried some code but it just doesn’t work! If someone could please help me it would be greatly appreciated! Here’s the code below (for the whole thing… there’s also one button that I have that when it is clicked on it makes the slideshow go automatically. Towards the bottom is where the other two buttons are, and my attempt at the arrow key method.)

 
square._alpha=0; // set movie clip called square to transparent i.e. alpha=0
mypic=1; // mypic is a variable we will use to count the images in the show
_root.ssOn=0; // button instance name ssOn is set to 0 or off when the program starts
statTimeSet=0; // staticTime variable set to 0 when the movie starts
_root.onEnterFrame = function() // _root main movie timeline, when movie starts call function
{
if (square._alpha <10) // if square movie contains image with less than 10% transparency
{
loadMovie("images/image"+mypic+".jpg", "square"); // load image1.jpg into movie square
fadeOut=false; // image is not fading out
fadeIn=true; // image fade In is set to true
}
if (square._alpha > 10 && fadeOut)
{
square._alpha -= 10; // if fading fade movie = movie – 10% alpha until faded out
}
if (square._alpha < 100 && fadeIn && !fadeOut) // if image is fading and not Out 
{
square._alpha += 10; // increment fade in 10% until completely faded in i.e. 100% alpha
}
else // if image is not fading in or out i.e. has loaded then do not fade in the image
{
fadeIn=false;
curTime = getTimer(); //create a variable curTime and set it to the current time object
if(!statTimeSet) // if stat Time variable is not set then set
{
statTime=curTime; // set static time = Current time built in
statTimeSet=1; // set statTimer to 1 or ON
}
if ((curTime >=statTime + 5000) && mypic <= 79 && !fadeIn && !fadeOut && _root.ssOn)
{
trace("curTime" + curTime)
trace ("statTime" + statTime)
fadeOut=true;
mypic++;
if (mypic > 79) // do not use >= or it will skip the last slide
{
mypic=1;
}
statTimeSet=0; // make sure this line is outsidet the if statement above it
}
}
// Below is code for the buttons
next.onRelease = function(){
 if(mypic < 79 && !fadeIn && !fadeOut)
 {
  fadeOut=true;
  mypic++;
 }
 if(mypic >= 79)
 {
  mypic=1;
 }
}
back.onPress = function()
{
 if(mypic > 1 && !fadeIn && !fadeOut)
 {
  fadeOut = true;
  mypic--;
 }
 if(mypic == 1 && !fadeIn && !fadeOut)
 {
  fadeOut = true;
  mypic = 79;
 }
 listen = new Object(); 
listen.onKeyDown = function() { 
if (Key.getCode() == Key.LEFT) { 
 if(mypic > 1 && !fadeIn && !fadeOut)
 {
  fadeOut = true;
  mypic--;
 }
 if(mypic == 1 && !fadeIn && !fadeOut)
 {
  fadeOut = true;
  mypic = 79;
 } 
} else if (Key.getCode() == Key.RIGHT) { 
if(mypic < 79 && !fadeIn && !fadeOut)
 {
  fadeOut=true;
  mypic++;
 }
 if(mypic >= 79)
 {
  mypic=1;
 }
}
} 
Key.addListener(listen);
}
}