PDA

View Full Version : Tabbing through components??


Israfel
01-09-2006, 01:41 PM
Hi,
I need to tab through various different Flash mx pro components. Now i know that using tabIndex deosnt work, it will stop dead as soon as it comes to a button or checkbox etc so i tried the focus manager, i put a key listener on the tab key which then called the getfocus to find which component has focus and then depending which component it is it calls a setfocus for the component i want next in the tab order. The problem is it deosnt work and i cant figure out why. When i trace out the setFocus call it acknowledges that the object i wanted focused should be in focus but it isnt, it goes to a different random component.

Has anyone come across this problem or a similar one before, is there a solution, All i want is a proper all inclusive tab order in my form, is that too much to ask of flash mx

Regards

Israfel
01-09-2006, 01:55 PM
Perhaps it would help if i showed you the code, give anyone in the know a better idea what i'm trying to do

//Description_txt.tabIndex = 0;
//tagId_txt.tabIndex = 1;
//savechanges_btn.tabIndex = 2;

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.TAB))
{
switch(focusManager.getFocus())
{
case _level0.Description_txt:
focusManager.setFocus(_level0.tagId_txt);
break;
case _level0.tagId_txt:
focusManager.setFocus(_level0.savechanges_btn);
break;
case _level0.savechanges_btn:
focusManager.setFocus(_level0.Description_txt);
break;
}
trace("Outside Switch:" + focusManager.getFocus());
}
};
Key.addListener(keyListener);