I have a situation where I need to clear the tabIndex and enter in a new one. What seems to be happening is the second tabIndex is ADDED TO the index, rather than replacing it, so TABbing just jumps back and forth between the two "1" indexes. Setting a different component to tab order 1 did not replace the current one. So, the question is, how do I clear the tabIndex so it will accept a whole new set?
Only buttons, textFields, and movieClips have a tabIndex property. According to the MM docs, tabIndex is undefined by default. Have you tried creating an array of the instance names of the items you want to tab through, and then manually assigning them a tabIndex number? I was having the same problem before so I did this and it seemed to work fine. code: var itemsToTab = ["button1_mc","button2_mc","textField1_tf","textField2_tf"] for (var j =0;j<itemsToTab.length;j++){ itemsToTab[j].tabIndex = j; } I know there's probably a hundred solutions out there better than this, so anyone with a better solution feel free... hope it helps. Cheers, FlashTastic
Hi FlashTastic, I am setting them like this: See Code Sample One. But then I want to change it when a mc, set off stage initially, is brought on the stage: See Code Sample Two. The first function is called when the movie starts. The second is called when a button is clicked. As I said before, the second one is not replacing he first, so it just toggles back and forth between the two "1" settings. //ONE function setMainMenuTabs() { textOne_ti.tabIndex = 1; textTwo_ti.tabIndex = 2; textThree_ti.tabIndex = 3; // etc. etc... } //TWO function setMcTabs() { mc.textOne_ti.tabIndex = 1; mc.textTwo_ti.tabIndex = 2; mc.textThree_ti.tabIndex = 3; // etc. etc... }
I Answer My Own Question... I kept trying to clear the FocusManager with one command: FocusManager.tabIndex = undefined // which did not work You must clear each component instance that you have assigned a tabIndex to individually. myInputText_ti.tabIndex = undefined; //etc. Then, you can define new ones. There is no single tabIndex list... each component stores its own... so setting a new one to the same value does not replace the old one.
Okay, I understand what you mean now... sorry 'bout the last post. The tabIndex property is a property of the movieclip and not a global property, so assigning a different movieclip to tabIndex = 1, will not change the old movieclip's tabIndex property. In theory you could have an unlimited number of clips with tabIndex = 1. You'll have to reset the old clips' tabIndex to null or undefined before setting your new clips' tabIndex. Does that make sense? Cheers, FlashTastic
Seems that you answered your question while I was answering your question..!
FlashTastic: I might want your help (paid, of course).. I will get back to you tomorrow.
I might be able to help.. Send me an e-mail offlist to flashtastic [at] gmail [dot] com. Cheers,
Don't see what you're looking for? Try a search.
|