E-mail List Archives
Thread: AccessibilityProperties in Flex
Number of posts in this thread: 3 (In chronological order)
From: Travis Roth
Date: Fri, Apr 27 2007 10:30AM
Subject: AccessibilityProperties in Flex
No previous message | Next message →
Hi,
Is it possible to set individual accessibility properties for Flex 2.0
components that have accessibility built in?
For example, I'd like to set the AccessibilityProperties.name property for a
ComboBox. Can I do this using MXML or ActionScript?
I know of the Best Practices and other resources found at
http://www.adobe.com/macromedia/accessibility/features/flex/ .
Is there more insight offered in other places?
Thanks.
From: Andrew Kirkpatrick
Date: Fri, Apr 27 2007 10:50AM
Subject: Re: AccessibilityProperties in Flex
← Previous message | Next message →
> 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
From: Andrew Kirkpatrick
Date: Fri, Apr 27 2007 11:10AM
Subject: Re: AccessibilityProperties in Flex
← Previous message | No next message
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>
>