Keyboard navigation

I’m making a presentation in flash with the arrow keys as navigation. I have it set up by section in my .fla. I have an intro in the main timeline for about 30 seconds. After that, it stops at the last frame of the intro. On that frame in the main timeline, I have action script to then play a movie clip when the arrow key is pressed. Here is the code I used:

this.onKeyDown = function() {
if (Key.getCode() == (Key.RIGHT)) {
gotoAndPlay(“greenBox_mc”);
Key.removeListener(this);
}
};
Key.addListener(this);

Each section of the presentation has it’s own movie clip that is accessed with the same script above. I have the AS for the Left arrow key at the end of each movie clip. That looks like this:

stop();
this.onKeyDown = function() {
if (Key.getCode() == (Key.LEFT)) {
gotoAndPlay(1);
Key.removeListener(this);
}
};
Key.addListener(this);

Then, in the middle of every other movie clip, I want it to stop and wait for the user to click one of the arrow keys. If they press left, I want it to go to the previous movie clip. If they press right, I want it to go to the next frame in the movie clip it’s already in. I can’t get this part to work properly. This is the AS I put for that part:

stop();
this.onKeyDown = function() {
if (Key.getCode() == (Key.RIGHT)) {
gotoAndPlay(41);
Key.removeListener(this);
}