
Tab index – This is an integer that basically allows you to put this text field in a list relative to all the other fields. The first one we should have a tabIndex of one, the second tabIndex of two, and so on. So suppose now you have the text field with tab index of one selected (which for TextFields just means that there is a cursor blinking inside of it). Then pressing tab will move your cursor to the TextField with index two. If you press tab again when the selection is on the text field the highest index then the list will loop back around, and the one that has index one will be selected.
var exampleTextField:TextField = new Textfield; exampleTextField.tabIndex = 1;
exampleTextField.tabEnabled = true;
public function setTabIndices(loginTabState:String):void { // First turn off tabIndex on all textfields. // Then turn on the ones for the current "loginTabState" disableAllLoginTextFields(); switch (loginTabState) { case "MAIN_POPUP": _loginMc["loginInputTxt"].tabIndex = 1; _loginMc["passInputTxt"].tabIndex = 2; _loginMc["loginInputTxt"].tabEnabled = true; _loginMc["passInputTxt"].tabEnabled = true; break; case "REGISTER_POPUP": _loginMc["registerPopup"]["emailTF"].tabIndex = 1; _loginMc["registerPopup"]["usernameTF"].tabIndex = 2; _loginMc["registerPopup"]["passwordTF"].tabIndex = 3; _loginMc["registerPopup"]["confirmPasswordTF"].tabIndex = 4; _loginMc["registerPopup"]["emailTF"].tabEnabled = true; _loginMc["registerPopup"]["usernameTF"].tabEnabled = true; _loginMc["registerPopup"]["passwordTF"].tabEnabled = true; _loginMc["registerPopup"]["confirmPasswordTF"].tabEnabled = true; break; case "FORGOT_POPUP": _loginMc["forgotPopup"]["forgotInput"].tabIndex = 1; _loginMc["forgotPopup"]["forgotInput"].tabEnabled = true; break; } } private function disableAllLoginTextFields():void { // login pop-up _loginMc["loginInputTxt"].tabIndex = 0; _loginMc["passInputTxt"].tabIndex = 0; _loginMc["loginInputTxt"].tabEnabled = false; _loginMc["passInputTxt"].tabEnabled = false; // forgot pop-up _loginMc["forgotPopup"]["forgotInput"].tabIndex = 0; _loginMc["forgotPopup"]["forgotInput"].tabEnabled = false; // register pop-up _loginMc["registerPopup"]["emailTF"].tabIndex = 0; _loginMc["registerPopup"]["usernameTF"].tabIndex = 0; _loginMc["registerPopup"]["passwordTF"].tabIndex = 0; _loginMc["registerPopup"]["confirmPasswordTF"].tabIndex = 0; _loginMc["registerPopup"]["emailTF"].tabEnabled = false; _loginMc["registerPopup"]["usernameTF"].tabEnabled = false; _loginMc["registerPopup"]["passwordTF"].tabEnabled = false; _loginMc["registerPopup"]["confirmPasswordTF"].tabEnabled = false; }
(TextField extends InteractiveObject and inherits the properties tabIndex and tabEnabled)