# Tab key problems still

**URL:** <https://forum.kirupa.com/t/tab-key-problems-still/263728>\
**Category:** flash\
**Created:** [June 18, 2008, 6:00pm UTC](https://forum.kirupa.com/t/tab-key-problems-still/263728 "2008-06-18T18:00:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemorris](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lemorris](https://forum.kirupa.com/u/lemorris)\
**Post date:** [June 18, 2008, 6:00pm UTC](https://forum.kirupa.com/t/tab-key-problems-still/263728/1 "2008-06-18T18:00:14Z")

</div>

I’m still having major issues with this Tab key situation. I tried to add a listener but nothing happens…I mean nothing happens.

keyListener.onKeyDown = function() {  
if (Key.isDown(Key.TAB)) {  
if(des.text != “FRED”){  
gotoAndStop(“10”);  
}  
}else{  
gotoAndStop(“20”);  
}  
};  
Key.addListener(keyListener);

can anyone help me understand what I’m doing wrong. My company is more than willing to pay for this help.

We want to set focus in atext field then when the user presses the Tab key we want to see what’s in the field and move on the timeline.

When I put the code above into a new file it works fine but if I put it into my course file or even bring it in using a loadmovie it doesn’t work anymore.

If I use a simple on realease key = tab on a button it works in a new file, but not in my course file.

Any thoughts? This is really critical.

Thank you

- lemorris

---

<div class="post-metadata">

**Author:** ![glosrfc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/glosrfc/32/8334_2.png) [@glosrfc](https://forum.kirupa.com/u/glosrfc)\
**Post date:** [June 18, 2008, 6:54pm UTC](https://forum.kirupa.com/t/tab-key-problems-still/263728/2 "2008-06-18T18:54:23Z")

</div>

If you’re addressing frame numbers you should use  
gotoAndStop(10);  
If you’re addressing frame labels, you should use  
gotoAndStop(“10”);

It might also be advisable to turn tab enabling off for your textfield  
des.tabEnabled = false;

You also need to create the keylistener object otherwise it won’t work, as you discovered  
var keyListener:Object = new Object();

```auto
des.tabEnabled = false;
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
	if (Key.isDown(Key.TAB)) {
		if (des.text != "FRED") {
			gotoAndStop(10);
		} else {
			gotoAndStop(20);
		}
	}
};
Key.addListener(keyListener);

```
