26.7.创建标签以设置访问顺序

26.7.1. 问题
我想支持那些使用指针设备有困难的用户(指针设备就是鼠标之类)
26.7.2. 解决办法
为组件定义一个标签顺序以便用户可以不使用指针设备而能导航应用程序
26.7.3. 讨论
标签顺序是应用程序非常重要的易用性指标。它能使用户无需频繁切换键盘和指针设备就能轻松导航整个应用程序。对于使用指针设备难得用户,标签顺序是很必要的。你可以设置每个对象的tabIndex属性以指定组件的标签顺序。下面的例子TabOrder.mxml,设置了标签顺序,这样用户就能不用鼠标也能轻松导航:
+展开
-XML
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolutecreationComplete="firstName.setFocus()">

<mx:Canvas width="228height="215x="50y="50"
backgroundColor="#FFFFFF">

<mx:Label x="10y="10text="First NametabIndex="1" />
<mx:TextInput x="10y="36width="100id="firstName"
tabIndex="2"/>

<mx:Label x="118y="10text="Last NametabIndex="3" />
<mx:TextInput x="118y="36width="100id="lastName"
tabIndex="4"/>

<mx:Label x="10y="69text="AddresstabIndex="5" />
<mx:TextInput x="10y="95width="208id="address"
tabIndex="6"/>

<mx:Label x="10y="125text="CitytabIndex="7"/>
<mx:TextInput x="10y="151width="100id="city"
tabIndex="8"/>

<mx:Label x="118y="125text="StatetabIndex="9"/>
<mx:TextInput x="118y="151width="34id="state"
tabIndex="10"/>

<mx:Label x="160y="125text="ZiptabIndex="11"/>
<mx:TextInput x="160y="151width="58id="zip"
tabIndex="12"/>

<mx:Button x="153y="181label="Submitid="submit"
tabIndex="13"/>

</mx:Canvas>
</mx:Application>

加支付宝好友偷能量挖...


评论(0)网络
阅读(98)喜欢(0)flash/flex/fcs/AIR