Thursday, October 20th, 2005 |
|
No tabbing for List, DataGrid, and Tree? |
I was adding my custom tab manager to a Flash project yesterday and found that my Tree component wasn’t being picked up in the tabbing order. After some debugging I found that the tabIndex for the List, DataGrid, and Tree components can no longer be set! This is new to Flash 8 and is horrible for accessibility.
Something changed in the components from Flash MX 2004 to Flash 8. Below there are two SWFs, the first one has the MX 2004 components, published as version 8, and the second one has the Flash 8 components, published as version 8. The code is listed below the SWFs.
Both SWFs were published for Flash player 8 but will run as expected in Flash player 7 as well.
In both cases I used the Accessibility panel to set the tabIndex. The order should be List(1), Get tabIndex(2), Set tabIndex(3), Button(4). You can change the tabIndex value of the List component (or attempt to for F8) by entering a number in the second text input box and pressing the “Set tabIndex” button. The current tabIndex will appear in the first text input box when pressing the “Get tabIndex” button.
Click in the SWF and press the tab key many times to see the cycling of focus:
Source: MX04Comps.zip (209KB) [FLA, SWF]
Notice the tab cycling in this SWF:
Source: F8Comps.zip (209KB) [FLA, SWF]
This is the code for each SWF.
var obj = new Object();
obj.click = function (event_obj)
{
switch(event_obj.target)
{
case b0_butn:
get_ti.text = test_lb.tabIndex;
break;
case b1_butn:
test_lb.tabIndex = set_ti.text;
break;
default:
// nothing
}
}
b0_butn.addEventListener('click',obj);
b1_butn.addEventListener('click',obj);
test_lb.addItem('Flash MX 2004');
test_lb.addItem('item 2');
test_lb.addItem('item 3');
In the second SWF you cannot tab to the List component. This is VERY wrong. In the MX04 example you can tab to the List and change a value. In the Flash 8 example you can’t get to the List without using your mouse. It means that the List, DataGrid, and Tree components are not accessible through the keyboard.
I have looked through the Classes folders for both MX04 and 8 and can’t see anything different that would cause this issue. Most of the files (for components) in the Flash 8 Classes folder are the same as the ones in the MX04 folder - same date and all. And I can’t see any differences in any of the seemingly relevant classes that have a newer date.
I haven’t seen this come up anywhere.
Has anyone else seen this? Does anyone have a fix for it?









There is a change in the mx.core.View class commenting out the set tabIndex ()function.
Here is the comment:
/*
removed to allow for the proper function of accessibility
*/
//function set tabIndex(n:Number)
//{
// __tabIndex = n;
//}
I’m checking up on it with a friend at MM as I write this. Excellent catch!
I tried adding mx.accessibility.ListAccImpl.enableAccessibility() to no avail.
Thanks Michael. I actually posted this as a bug to Macromedia yesterday and just got a reply a few minutes before you posted!
Here is the message I received (I got approval to post this):
So Macromedia is already planning to do a technote on this.
I also asked about the comment that mentions accessibility and apparently this is a leftover from some work they were trying to do with the components. In trying to revert the code, this commented out part was missed.
“Excellent catch!”
Actually, I should say that to you!
You could recompile the component SWC’s after updating the class but that’s a bit more labor intensive than the dummy class variable workaround.
Thanks a Lot for your valuable information on tab order
Thanks Again !!!!
Regards,
Shiv Nikum