AS2: key presses and moving a movieclip

I am making a sort of like racing game maze thing but want it so that when the user hits for example the right arrow key the movie clip moves along it’s x axis and doesn’t stop until another key is hit or the movieclip hits another movieclip.

I was thinking about making a function that some how loops the x distance and this function is being called when ever the keyboard key is hit.

Sound this sound about right and does anyone have any idea about the syntax for getting it to move along continuasly.

Thank you for any help!