Tab key problems still

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

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();

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);