This page was saved using jaction on 09/04/06 8:33:22.
Address: http://flexdocs.kr/docs/flex2/langref/flash/accessibility/Accessibility.html
Title: flash.accessibility.Accessibility (Flex™ 2 레퍼런스 가이드)  •  Size: 29375
Packageflash.accessibility
Classpublic final class Accessibility
InheritanceAccessibility Inheritance Object

Accessibility 클래스는, screen reader와의 통신을 관리합니다. screen reader는, 시각 장해가 있는 유저용으로, 화면의 내용을 음성으로 출력하는 보조 기술입니다. Accessibility 클래스의 Methods는 정적입니다. 즉, 클래스의 인스턴스를 작성하지 않아도, 이 클래스의 Methods를 사용할 수 있습니다.

버튼이나 무비 클립, 텍스트 필드 등, 특정의 object의 accessibility프로파티를 취득 또는 설정하려면 ,DisplayObject.accessibilityProperties property를 사용합니다. Player 가 accessibility 보조를 지원(support)하는 환경에서 실행되고 있는지 어떤지를 확인하려면 ,Capabilities.hasAccessibility property를 사용합니다.

View the examples

See also

flash.display.DisplayObject.accessibilityProperties
flash.system.Capabilities.hasAccessibility
Socket


Public property
 property정의
  active : Boolean
[static][read-only] screen reader가 현재 액티브 상태로, Player 와 통신하고 있을지 어떨지를 나타냅니다.
Accessibility
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
Public Methods
 Methods정의
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
 InheritedtoString ():String
지정된 object의 string 표현을 돌려줍니다.
Object
  updateProperties ():void
[static] DisplayObject.accessibilityProperties property를 사용해 변경된 accessibility를 모두 Flash Player 에 적용시킵니다.
Accessibility
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
property의 상세
activeproperty
active:Boolean   [read-only]

screen reader가 현재 액티브 상태로, Player 와 통신하고 있을지 어떨지를 나타냅니다. screen reader의 실행시에 어플리케이션의 동작을 변경하려면 , 이 Methods를 사용합니다.

메모 : 문서를 재생하는 Flash® 윈도우가 최초로 표시된 후, 이 Methods를 1, 2 초 이내에 호출하면, 액티브 상태의 accessibility크라이안트가 존재해도,false 값가 돌려주어지는 일이 있습니다. 이것은, Flash 와 accessibility크라이안트와의 사이의 통신이 비동기이기 위해서(때문에) 발생합니다. 이 문제를 회피하려면 , 문서를 읽어들인 후, 반드시 1, 2 초 경과하고 나서, 이 Methods를 호출해 주세요.

screen reader를 지원(support)하는 환경에서 Player 가 실행되고 있는지 어떤지 확인하려면 ,Capabilities.hasAccessibility property를 사용합니다. Implements
    public static function get active():Boolean

See also

Methods의 상세
updateProperties()Methods
public static function updateProperties():void

DisplayObject.accessibilityProperties property를 사용해 변경된 accessibility를 모두 Flash Player 에 적용시킵니다. 변경 내용을 유효하게 하려면 , 이 Methods를 호출할 필요가 있습니다.

복수의 object의 accessibility프로파티를 변경하는 경우, 필요한 Accessibility.updateProperties() Methods 호출은 1 회 뿐입니다. 몇번이나 호출하면, 퍼포먼스가 저하할 뿐만 아니라, screen reader가 잘못한 출력을 생성할 가능성이 있습니다.


Throws
IllegalOperationError — Flash Player 의 이 버젼에서는 accessibility가 지원(support)되지 않습니다. flash.system.Capabilities.hasAccessibility property가 false 때에는,Accessibility.updateProperties() Methods를 호출하지 말아 주세요.

See also

Examples

다음의 코드의 예에서는,AccessibilityExample, CustomAccessibleButton,CustomSimpleButton, 및 ButtonDisplayState 샘플 클래스를 사용해, 대부분의 screen reader와의 제휴가 가능한 accessibility 준거 메뉴를 작성합니다. 이 예에서는, 다음의 처리를 실행합니다.
  1. Accessibility.active property를 추적해, screen reader가 현재 액티브 상태로 Player 와 통신하고 있을지 어떨지를 확인합니다.
  2. active property가 true 를 돌려주는 경우에는, 이 예에서는 updateProperties() Methods를 호출해, 이 예의 버튼에 대한 accessibility상의 변경을 적용합니다.
  3. 이 예에서는,flash.utils.setTimeout() Methods를 호출해, updateAccessibility() 크로 전기밥통 Methods를 2 초 후에 호출하도록(듯이) 지정합니다.

메모 : setTimeout() 은,Accessibility.active 의 검사전에 호출해 주세요. 이렇게 하면, Flash Player 가 screen reader (사용 가능한 경우)에게 접속하는데 필요한 2 초간을 확보할 수가 있습니다. 충분한 지연 시간을 지정하지 않는 경우, screen reader가 사용 가능해도,setTimeout 호출에서는, false 가 돌려주어집니다.

다음의 예에서는, Accessibility.updateProperties() Methods가 처리되는 것은,Accessibility.active 호출이 true 를 돌려주는 경우만입니다. 즉, Flash Player 가 액티브 상태의 screen reader에게 현재 접속하고 있는 경우만입니다. updateProperties 가 불려 갔을 때에 screen reader가 액티브 상태가 아닌 경우,IllegalOperationError 예외가 슬로우 됩니다.

package {
    import flash.display.Sprite;
    import flash.accessibility.Accessibility;
    import flash.utils.setTimeout;
    
    public class AccessibilityExample extends Sprite {
        public static const BUTTON_WIDTH:uint = 90;
        public static const BUTTON_HEIGHT:uint = 20;
        
        private var gutter:uint = 5;
        private var menuLabels:Array = new Array("PROJECTS", "PORTFOLIO", "CONTACT");
        private var menuDescriptions:Array = new Array("Learn more about our projects"
                                                     , "See our portfolio"
                                                     , "Get in touch with our team");
        
        public function AccessibilityExample() {
            configureAssets();
            setTimeout(updateAccessibility, 2000); 
        }
        
        private function updateAccessibility() :void {
            trace("Accessibility.active: " + Accessibility.active);
            if(Accessibility.active) {
                Accessibility.updateProperties();
            }
        }
        
        private function configureAssets() :void {
            var child:CustomAccessibleButton;
            for(var i:uint; i < menuLabels.length; i++) {
                child = new CustomAccessibleButton();
                child.y = (numChildren * (BUTTON_HEIGHT + gutter));
                child.setLabel(menuLabels[i]);
                child.setDescription(menuDescriptions[i]);
                addChild(child);
            }
        }
    }
}
    
import flash.accessibility.AccessibilityProperties;
import flash.display.Shape;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextFormat;
import flash.text.TextField;


class CustomAccessibleButton extends Sprite {
    private var button:SimpleButton;
    private var label:TextField;
    private var description:String;
    private var _name:String;
        
    public function CustomAccessibleButton(_width:uint = 0, _height:uint = 0) {
        _width = (_width == 0) ?  AccessibilityExample.BUTTON_WIDTH : _width;
        _height = (_height == 0) ?  AccessibilityExample.BUTTON_HEIGHT : _height;
        
        button = buildButton(_width, _height);
        label = buildLabel(_width, _height);
            
        addEventListener(Event.ADDED, addedHandler);
    }
        
    private function addedHandler(event:Event) :void {
        trace("addedHandler: " + this. _name);
        var accessProps:AccessibilityProperties = new AccessibilityProperties();
        accessProps.name = this. _name;
        accessProps.description = description;
        accessibilityProperties = accessProps;
        removeEventListener(Event.ADDED, addedHandler);
    }
        
    private function buildButton(_width:uint, _height:uint) :SimpleButton {
        var child:SimpleButton = new CustomSimpleButton(_width, _height);
        addChild(child);
        return child;
    }

    private function buildLabel(_width:uint, _height:uint) :TextField {
        var format:TextFormat = new TextFormat();
        format.font = "Verdana";
        format.size = 11;
        format.color = 0xFFFFFF;
        format.align = TextFormatAlign.CENTER;
        format.bold = true;
        
        var child:TextField = new TextField();
        child.y = 1;
        child.width = _width;
        child.height = _height;
        child.selectable = false;
        child.defaultTextFormat = format;
        child.mouseEnabled = false;
            
        addChild(child);
        return child;
    }
        
    public function setLabel(text:String) :void {
        label.text = text;
        this. _name = text;
    }
        
    public function setDescription(text:String) :void {
        description = text;
    }
}
    
class CustomSimpleButton extends SimpleButton {
    private var upColor:uint = 0xFFCC00;
    private var overColor:uint = 0xCCFF00;
    private var downColor:uint = 0x00CCFF;

    public function CustomSimpleButton(_width:uint, _height:uint) {
        downState = new ButtonDisplayState(downColor, _width, _height);
        overState = new ButtonDisplayState(overColor, _width, _height);
        upState = new ButtonDisplayState(upColor, _width, _height);
        hitTestState = new ButtonDisplayState(upColor, _width, _height);
        useHandCursor = true;
    }        
}

class ButtonDisplayState extends Shape {
    private var bgColor:uint;
    private var _width:uint;
    private var _height:uint;

    public function ButtonDisplayState(bgColor:uint, _width:uint, _height:uint) {
        this.bgColor = bgColor;
        this. _width = _width;
        this. _height = _height;
        draw();
    }

    private function draw() :void {
        graphics.beginFill(bgColor);
        graphics.drawRect(0, 0, _width, _height);
        graphics.endFill();
    }
}






 

코멘트가 추가되었을 경우, 메일로 받기. | 코멘트 리포트

현재의 페이지: http://flexdocs.kr/docs/flex2/langref/flash/accessibility/Accessibility.html