Flex Accessiblity - Reading out a label/text

假如想象 提交于 2019-12-25 01:55:31

问题


I need to make a small app accessible to screen reader.

I'm managing to make buttons accessible, but I would also like to have a section of text accessible by screen readers so that users can hear what the text says.

I can't seem to work out how to do this.. I've tried various text controls and set them as focusEnabled, tabEnabled, i've set the accessibility* attributes too but it never seems to work, I cannot tab to a text label and hear the content.

I'm honestly a little new to accessiblity in Flex so apologies if i'm missing something obvious.

Anyone has any suggestion on this?

Thanks

Using Flex 4 + Jaws


回答1:


You need to make classes that extend your relevant text-components and explicitly implement IFocusManagerComponent. Luckily, all of the methods to implement IFocusManagerComponent are fulfilled in UIComponent, so merely declaring the implementation in the subclasses should be sufficient for the FocusManager to detect them.

package scrap
{
    import mx.managers.IFocusManagerComponent;

    import spark.components.RichText;

    public class FocusableRichText extends RichText implements IFocusManagerComponent
    {
        public function FocusableRichText()
        {
            super();
        }
    }
}

The exact same trick works for Label. Just use these nigh-trivial subclasses where-ever you would otherwise place your accessibility-oriented textual components.



来源:https://stackoverflow.com/questions/4295728/flex-accessiblity-reading-out-a-label-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!