適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.accessibility 

AccImpl  - AS3 Flex

套件mx.accessibility
類別public class AccImpl
繼承AccImpl Inheritance AccessibilityImplementation Inheritance Object
子類別 AccordionHeaderAccImpl, ButtonAccImpl, ButtonBaseAccImpl, ComboBaseAccImpl, DateChooserAccImpl, DateFieldAccImpl, LabelAccImpl, ListBaseAccImpl, ListBaseAccImpl, MenuBarAccImpl, PanelAccImpl, PanelAccImpl, RichEditableTextAccImpl, SliderAccImpl, SliderBaseAccImpl, SpinnerAccImpl, TabBarAccImpl, TextBaseAccImpl, TreeAccImpl, VideoPlayerAccImpl

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

AccImpl is Flex's base accessibility implementation class for MX and Spark components.

It is a subclass of the Flash Player's AccessibilityImplementation class.

When an MX or Spark component is created, its accessibilityImplementation property is set to an instance of a subclass of this class. The Flash Player then uses this object to allow MSAA clients such as screen readers to see and manipulate the component. See the flash.accessibility.AccessibilityImplementation class for additional information about accessibility implementation classes and MSAA.

Children

The Flash Player does not support a true hierarchy of accessible objects. If a DisplayObject has an accessibilityImplementation object, then the accessibilityImplementation objects of its children are ignored. However, the Player does allow a component's accessibility implementation class to expose MSAA information for its internal parts. (For example, a List exposes MSAA information about its items.)

The number of children (internal parts) and the child IDs used to identify them are determined by the getChildIDArray() method. In the Player's AccessibilityImplementation base class, this method simply returns null. Flex's AccImpl class overrides it to return an empty array. It also provides a protected utility method, createChildIDArray() which subclasses with internal parts can use in their overrides.

Role

The MSAA Role of a component and its internal parts is determined by the get_accRole() method. In the Player's AccessibilityImplementation base class, this method throws a runtime error, since subclasses are expected to override it. Flex's AccImpl class has a protected role property which subclasses generally set in their constructor, and it overrides get_accRole() to return this property.

Name

The MSAA Name of a component and its internal parts is determined by the get_accName() method. In the Player's AccessibilityImplementation base class, this method simply returns null. Flex's AccImpl class overrides it to construct a name as follows, starting with an empty string and separating added portions with a single space:

  • If a simple child (e.g., combo or list box item) is being requested, only the child's default name is returned. The rest of the steps below apply only to the component itself (childID 0).
  • If the component is inside a Form:
    • If the Form has a FormHeading and the component is inside a FormItem, the heading text is added. Developers wishing to avoid this should set the accessibilityName of the FormHeading to a space (" ").
    • If the field is required, the locale-dependent string "required field" is added.
    • If the component is inside a FormItem, the FormItem label text is added. Developers wishing to avoid this should set the accessibilityName of the FormItem to a space (" ").
  • The component's name is then determined thus:
    • If the component's accessibilityName (i.e., accessibilityProperties.name) is a space, no component name is added.
    • Otherwise, if the component's name is specified (i.e., is not null and not empty) then it is added.
    • Otherwise, a protected getName() method, defined by AccImpl and implemented by each subclass, is called to provide a default name. (For example, ButtonAccImpl implements getName() to specify that a Button's default name is the label that it displays.) If not empty, the return value of getName() is added.
    • Otherwise (if getName() returned empty), if the component's toolTip property is set, that String is added.
    • If the component's errorString property is set, that String is added.

Description

The MSAA Description is determined solely by a component's accessibilityProperties object and not by its accessibilityImplementation object. Therefore there is no logic in AccessibilityImplementation or AccImpl or any subclasses of AccImpl related to the description. The normal way to set the description in Flex is via the accessibilityDescription property on UIComponent, which simply sets accessibilityProperties.description.

State

The MSAA State of a component and its internal parts is determined by the get_accState() method. In the Player's AccessibilityImplementation base class, this method throws a runtime error, since subclasses are expected to override it. Flex's AccImpl class does not override it, but provides a protected utility method, getState(), for subclasses to use in their overrides. The getState() method determines the state as a combination of

  • STATE_SYSTEM_UNAVAILABLE (when enabled is false on this component or any ancestor)
  • STATE_SYSTEM_FOCUSABLE
  • STATE_SYSTEM_FOCUSED (when the component itself is focused, not set for any subparts the component may have)
Note that by default all components are assumed to be focusable and thus the accessibility implementation classes for non-focusable components like Label must clear this state flag. When a component has a state of unavailable, the focusable state is removed by the accessibility implementation class.

Value

The MSAA Value of a component and its internal parts is determined by the get_accValue() method. In the Player's AccessibilityImplementation base class, this method simply returns null. Flex's AccImpl class does not override it, but subclasses for components like TextInput do.

Location

The MSAA Location for a component's internal parts, but not the component itself, is determined by the get_accLocation() method. This method is never called with a childID of 0; instead, the Flash Player determines the MSAA Location of a component based on its bounding rectangle as determined by getBounds(). Flex's AccImpl class does not override this method, but subclasses for components with internal parts do.

Default Action

The MSAA DefaultAction for a component and its internal parts is determined by the get_accDefaultAction() method. In the Player's AccessibilityImplementation base class, this method simply returns null. Flex's AccImpl class does not override it, but subclasses with default actions do. These subclasses also override AccessibilityImplementation's accDoDefaultAction() method to perform the default action that they advertise.

Other

The MSAA events EVENT_OBJECT_SHOW and EVENT_OBJECT_HIDE are sent when the object is shown or hidden. The corresponding states for these are covered by the Flash Player which does not render any MSAA components that are hidden. When the component is shown the states mentioned for AccImpl are used.



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
 Inheritederrno : uint
指出錯誤碼。
AccessibilityImplementation
 Inheritedstub : Boolean
用於建立組件輔助功能虛設常式。
AccessibilityImplementation
保護屬性
 屬性定義自
  eventsToHandle : Array
[唯讀] All subclasses must override this function by returning an array of strings of the events to listen for.
AccImpl
  master : UIComponent
A reference to the UIComponent instance that this AccImpl instance is making accessible.
AccImpl
  role : uint
Accessibility role of the component being made accessible.
AccImpl
公用方法
 方法定義自
  
Constructor.
AccImpl
 Inherited
IAccessible 方法會執行與組件關聯的預設動作,而該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
accLocation(childID:uint):*
MSAA 方法適用於傳回 DisplayObject 或 Rectangle,以便在 AccessibilityImplementation 中指定子系元素的範圍框。
AccessibilityImplementation
 Inherited
accSelect(operation:uint, childID:uint):void
用於改變組件中之選擇的 IAccessible 方法,該組件是由此 AccessibilityImplementation 所代表。
AccessibilityImplementation
 Inherited
傳回組件預設動作的 MSAA 方法,該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
傳回子元素 (如果有的話) 無正負號整數 ID 的 MSAA 方法,該子元素在組件中具有子元素焦點。
AccessibilityImplementation
 Inherited
傳回組件名稱的 MSAA 方法,該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
傳回組件系統角色的 MSAA 方法,該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
傳回陣列的 MSAA 方法,該陣列包含所有選取子元素的 ID。
AccessibilityImplementation
 Inherited
傳回組件目前執行階段狀態的 IAccessible 方法,該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
傳回組件執行階段值的 MSAA 方法,該組件是由此 AccessibilityImplementation 或其子元素之一所代表。
AccessibilityImplementation
 Inherited
AccessibilityImplementation
 Inherited
AccessibilityImplementation
 Inherited
傳回陣列,其中包含 AccessibilityImplementation 所有子元素的無正負號整數 ID。
AccessibilityImplementation
  
[靜態] Method for supporting Form Accessibility.
AccImpl
 Inherited
指出物件是否有已定義的指定屬性。
Object
  
[靜態] Returns true if an ancestor of the component has enabled set to false.
AccImpl
 Inherited
傳回 true 或 false,以指出具有由 x、y、width 與 height 所指定之範圍框的文字物件,是否應該被視為此 AccessibilityImplementation 所代表之組件的標籤。
AccessibilityImplementation
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
保護方法
 方法定義自
  
Generic event handler.
AccImpl
  
Returns the name of the accessible component.
AccImpl
  
getState(childID:uint):uint
Utility method to determine state of the accessible component.
AccImpl
屬性詳細資訊

eventsToHandle

屬性
eventsToHandle:Array  [唯讀]

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

All subclasses must override this function by returning an array of strings of the events to listen for.



實作
    protected function get eventsToHandle():Array

master

屬性 
protected var master:UIComponent

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

A reference to the UIComponent instance that this AccImpl instance is making accessible.

role

屬性 
protected var role:uint

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Accessibility role of the component being made accessible.

建構函式詳細資料

AccImpl

()建構函式
public function AccImpl(master:UIComponent)

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constructor.

參數
master:UIComponent — The UIComponent instance that this AccImpl instance is making accessible.
方法詳細資訊

eventHandler

()方法
protected function eventHandler(event:Event):void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Generic event handler. All AccImpl subclasses must implement this to listen for events from its master component.

參數

event:Event

getFormName

()方法 
public static function getFormName(component:UIComponent):String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Method for supporting Form Accessibility. Called from get_accName() in this AccImpl class. Also called from the UIComponentAccProps constructor.

參數

component:UIComponent

傳回值
String

getName

()方法 
protected function getName(childID:uint):String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Returns the name of the accessible component. All subclasses must implement this instead of implementing get_accName().

參數

childID:uint

傳回值
String

getState

()方法 
protected function getState(childID:uint):uint

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Utility method to determine state of the accessible component.

參數

childID:uint

傳回值
uint

isAncestorDisabled

()方法 
public static function isAncestorDisabled(component:UIComponent):Boolean

Returns true if an ancestor of the component has enabled set to false. The given component itself is not checked.

參數

component:UIComponent — The UIComponent to check for a disabled ancestor.

傳回值
Boolean — true if the component has a disabled ancestor.




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。