# Help with Caps Lock Function - CS3

**URL:** <https://forum.kirupa.com/t/help-with-caps-lock-function-cs3/287075>\
**Category:** flash\
**Created:** [April 25, 2009, 5:36pm UTC](https://forum.kirupa.com/t/help-with-caps-lock-function-cs3/287075 "2009-04-25T17:36:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JinxBunny](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@JinxBunny](https://forum.kirupa.com/u/JinxBunny)\
**Post date:** [April 25, 2009, 5:36pm UTC](https://forum.kirupa.com/t/help-with-caps-lock-function-cs3/287075/1 "2009-04-25T17:36:48Z")

</div>

Hey, I just need this simple function to change a movie script depending on wether the caps lock button is pressed or not,  
I have this so far is AS2 which works -

```auto
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
    if (Key.isDown(Key.CAPSLOCK)) {
	_root.my_mc.gotoAndStop("on");
	}
}
Key.addListener(keyListener);

```

- but what can I add so that the my\_mc goes back to “off”

I’ve tried

```auto
else {
 _root.my_mc.gotoAndStop("off");
	}

```

but this doesn’t help, any advice? thanks!
