Sorry. My mistake! forgot to post the code. 
var key:uint = e.keyCode;
The code is:
var key:uint = e.keyCode;
images.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed)
function keyPressed(e:Keyboard):void
{
if(key==37){
images_mc.gotoAndStop(images_mc.currentFrame - 1)
}else if(key==39){
images_mc.gotoAndStop(images_mc.currentFrame + 1)
}
}
the scope of e is only inside the function,
so when you write
var key:uint = e.keyCode;
Flash doesn`t know of any object called e
you have to rewrite like so:
var key:uint;
and then inside the keyPressed function you write:
...
key = e.keyCode
if(key==37){...
Beware of using any keyWords, when in doubt if "key" is a name flash has reserved internally always use a leading underscore (_key)