# What's wrong with my AS

**URL:** https://forum.kirupa.com/t/whats-wrong-with-my-as/101805
**Category:** Uncategorized
**Created:** [February 14, 2004, 4:52am UTC](https://forum.kirupa.com/t/whats-wrong-with-my-as/101805 "2004-02-14T04:52:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jbrereton3](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jbrereton3](https://forum.kirupa.com/u/jbrereton3)
#### Post date: [February 14, 2004, 4:52am UTC](https://forum.kirupa.com/t/whats-wrong-with-my-as/101805/1 "2004-02-14T04:52:22Z")

</div>

Why wont the code, Key.isUp work???

I need it so when the right key is relesed, the timeline goes back to frame 1.

* * *

this.onKeyDown = function() {  
if (Key.isDown(Key.RIGHT)) {  
this.gotoAndPlay(2);  
}  
if (Key.isUp(Key.RIGHT)) {  
this.gotoAndPlay(1);  
}  
};  
this.stop();  
Key.addListener(this);

* * *

Thanks!!!
