# Keypress problem

**URL:** https://forum.kirupa.com/t/keypress-problem/200892
**Category:** Uncategorized
**Created:** [September 16, 2006, 6:24am UTC](https://forum.kirupa.com/t/keypress-problem/200892 "2006-09-16T06:24:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Bill\_Blast](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@Bill\_Blast](https://forum.kirupa.com/u/Bill_Blast)
#### Post date: [September 16, 2006, 6:24am UTC](https://forum.kirupa.com/t/keypress-problem/200892/1 "2006-09-16T06:24:46Z")

</div>

I’ve created a simple menu that fades in with a key press and fades out on releasing the keypress. It seems to be working but it only works once. If I press again - nothing happens. Can anyone help? Please? I’ve uploaded the file.

You solve it - I bring marshmallows! No, I make joke - you like laugh?

onClipEvent (load) {  
\_root.menuin.\_alpha = 0;  
}  
onClipEvent (keyDown) {  
if (Key.isDown(32)) {  
\_root.menuin.\_alpha += 10;  
}  
}  
onClipEvent (keyUp) {  
\_root.menuin.onEnterFrame = function() {  
if (\_root.menuin.\_alpha\>0) {  
\_root.menuin.\_alpha -= 10;  
}  
};  
}
