# HELP : onKeyPress LEFT

**URL:** <https://forum.kirupa.com/t/help-onkeypress-left/279986>\
**Category:** flash\
**Created:** [January 21, 2009, 12:06pm UTC](https://forum.kirupa.com/t/help-onkeypress-left/279986 "2009-01-21T12:06:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BUroKHUli](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/burokhuli/32/190_2.png) [@BUroKHUli](https://forum.kirupa.com/u/BUroKHUli)\
**Post date:** [January 21, 2009, 12:06pm UTC](https://forum.kirupa.com/t/help-onkeypress-left/279986/1 "2009-01-21T12:06:48Z")

</div>

Hello,

May I ask for help on actionscripting. I am not much of a scripting guy and can only do so little about it. However, I managed to find a script that works for my simple animation that PLAYS the movie everytime I hit the RIGHT ARROW KEY. Now I am was wondering if it is possible to allow the PLAYHEAD to go back to the PREVIOUS MARKER / LABEL ON THE TIMELINE when LEFT ARROW KEY is pressed. What I have below is just a single MARKER which basically resets the playhead to the very beginning. I was thinking if this idea would work

gotoAndPlay(“gotoPreviousMarker”);

Thank you very much  
ALLAN

var keyListener:Object = new Object();  
keyListener.onKeyDown = function() {  
if (Key.isDown(Key.LEFT)) {  
gotoAndPlay(“splash01”);  
}  
if (Key.isDown(Key.RIGHT)) {  
play();  
}  
};  
Key.addListener(keyListener);
