Sunday, 10 February 2008

Flex and tabbing - get to anything...

Flex developers need to be aware of accessible content these days, and that includes the infamous tabbing phenomenon. Always been a bugbear with the Flash Player. Flex takes most of this pain away, but any custom components could have you tearing your hair out.

For instance, create custom button class extending Canvas; set buttonMode to true, set focusEnabled to true. Still nothing.

Step in IFocusManagerComponent. Interestingly, UIComponent implements this interface, which is what the FocusManager looks at to decide whether, or not, to focus your component. All you need to do is explicitly tell Flex that your component implements it, and you're away:

<?xml version="1.0"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" implements="mx.managers.IFocusManagerComponent"
buttonMode="true" focusEnabled="true">
...
</mx:Canvas>


Hopefully that'll clear this up for some people as this drove me round the bend several times.

No comments:

Post a Comment