WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: AccessibilityProperties in Flex

for

From: Andrew Kirkpatrick
Date: Apr 27, 2007 11:10AM


Forgot one thing. In my message below I write a function, but didn't
show how it is called. In the case where you want the name set when the
app is loaded, you can use creationComplete in the mx:Application
element, as shown in the complete application source below.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="absolute" width="100%" height="100%" creationComplete="init()">
<mx:Script>
<![CDATA[
public function init():void{
myComboBox.accessibilityProperties = new
AccessibilityProperties();
myComboBox.accessibilityProperties.name = "I am read
from Accessibility Properties name";
myComboBox.accessibilityProperties.description = "I am
read from Accessibility Properties description";
Accessibility.updateProperties();
}

[Bindable]
public var cards: Array = [ {label:"Visa", data:1}, {label:"Master
Card", data:2}, {label:"American Express", data:3} ];

]]>
</mx:Script>
<mx:VBox>
<mx:Label text="This file has a regular checkbox, a
disabled checkbox, and a checkbox with a text label and a toolTip"/>
<mx:TextInput/>
<mx:ComboBox dataProvider="{cards}" id="myComboBox"/>
<mx:CheckBox label="Beef" enabled="false"/>
<mx:CheckBox label="Vegetarian" toolTip="May include
seafood"/>
</mx:VBox>
</mx:Application>

> -----Original Message-----
> From: <EMAIL REMOVED>
> [mailto: <EMAIL REMOVED> ] On Behalf Of
> Andrew Kirkpatrick
> Sent: Friday, April 27, 2007 12:46 PM
> To: <EMAIL REMOVED> ; WebAIM Discussion List
> Subject: Re: [WebAIM] AccessibilityProperties in Flex
>
>
> > Is it possible to set individual accessibility properties
> for Flex 2.0
> > components that have accessibility built in?
>
> Sure is. Here, for example is how you can set the name on a
> comboBox that has id="myComboBox" :
>
> <mx:Script>
> <![CDATA[
> public function init():void{
> myComboBox.accessibilityProperties = new
> AccessibilityProperties();
> myComboBox.accessibilityProperties.name = "Put
> the appropriate name here";
> Accessibility.updateProperties();
> }
> ]]>
> </mx:Script>
>
> > For example, I'd like to set the
> AccessibilityProperties.name property
> > for a ComboBox. Can I do this using MXML or ActionScript?
>
> If you just want the name you can use the code above in
> actionscript or you can use toolTip on the <mx:ComboBox>
> element and the compiler also uses that for the accessibility name.
>
> AWK
>