<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - flash - 9.0 - ActionScriptLangRefV3 - flash/accessibility/Accessibility.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-26T10:57:38</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/accessibility/Accessibility.html#80915" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/accessibility/Accessibility.html#80915">
		<title>flash/9.0/ActionScriptLangRefV3/flash/accessibility/Accessibility.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/accessibility/Accessibility.html#80915</link>
		<description>package {&lt;br /&gt;    import flash.display.Sprite;&lt;br /&gt;    import flash.accessibility.Accessibility;&lt;br /&gt;    import flash.utils.setTimeout;&lt;br /&gt;    &lt;br /&gt;    public class AccessibilityExample extends Sprite {&lt;br /&gt;        public static const BUTTON_WIDTH:uint = 90;&lt;br /&gt;        public static const BUTTON_HEIGHT:uint = 20;&lt;br /&gt;        &lt;br /&gt;        private var gutter:uint = 5;&lt;br /&gt;        private var menuLabels:Array = new Array(&quot;PROJECTS&quot;, &quot;PORTFOLIO&quot;, &quot;CONTACT&quot;);&lt;br /&gt;        private var menuDescriptions:Array = new Array(&quot;Learn more about our projects&quot;&lt;br /&gt;                                                     , &quot;See our portfolio&quot;&lt;br /&gt;                                                     , &quot;Get in touch with our team&quot;);&lt;br /&gt;        &lt;br /&gt;        public function AccessibilityExample() {&lt;br /&gt;            configureAssets();&lt;br /&gt;            setTimeout(updateAccessibility, 2000); &lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private function updateAccessibility():void {&lt;br /&gt;            trace(&quot;Accessibility.active: &quot; + Accessibility.active);&lt;br /&gt;            if(Accessibility.active) {&lt;br /&gt;                Accessibility.updateProperties();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private function configureAssets():void {&lt;br /&gt;            var child:CustomAccessibleButton;&lt;br /&gt;            for(var i:uint; i &lt; menuLabels.length; i++) {&lt;br /&gt;                child = new CustomAccessibleButton();&lt;br /&gt;                child.y = (numChildren * (BUTTON_HEIGHT + gutter));&lt;br /&gt;                child.setLabel(menuLabels[i]);&lt;br /&gt;                child.setDescription(menuDescriptions[i]);&lt;br /&gt;                addChild(child);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;    &lt;br /&gt;import flash.accessibility.AccessibilityProperties;&lt;br /&gt;import flash.display.Shape;&lt;br /&gt;import flash.display.SimpleButton;&lt;br /&gt;import flash.display.Sprite;&lt;br /&gt;import flash.events.Event;&lt;br /&gt;import flash.text.TextFormat;&lt;br /&gt;import flash.text.TextField;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class CustomAccessibleButton extends Sprite {&lt;br /&gt;    private var button:SimpleButton;&lt;br /&gt;    private var label:TextField;&lt;br /&gt;    private var description:String;&lt;br /&gt;    private var _name:String;&lt;br /&gt;        &lt;br /&gt;    public function CustomAccessibleButton(_width:uint = 0, _height:uint = 0) {&lt;br /&gt;        _width = (_width == 0) ? AccessibilityExample.BUTTON_WIDTH : _width;&lt;br /&gt;        _height = (_height == 0) ? AccessibilityExample.BUTTON_HEIGHT : _height;&lt;br /&gt;        &lt;br /&gt;        button = buildButton(_width, _height);&lt;br /&gt;        label = buildLabel(_width, _height);&lt;br /&gt;            &lt;br /&gt;        addEventListener(Event.ADDED, addedHandler);&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    private function addedHandler(event:Event):void {&lt;br /&gt;        trace(&quot;addedHandler: &quot; + this._name);&lt;br /&gt;        var accessProps:AccessibilityProperties = new AccessibilityProperties();&lt;br /&gt;        accessProps.name = this._name;&lt;br /&gt;        accessProps.description = description;&lt;br /&gt;        accessibilityProperties = accessProps;&lt;br /&gt;        removeEventListener(Event.ADDED, addedHandler);&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    private function buildButton(_width:uint, _height:uint):SimpleButton {&lt;br /&gt;        var child:SimpleButton = new CustomSimpleButton(_width, _height);&lt;br /&gt;        addChild(child);&lt;br /&gt;        return child;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private function buildLabel(_width:uint, _height:uint):TextField {&lt;br /&gt;        var format:TextFormat = new TextFormat();&lt;br /&gt;        format.font = &quot;Verdana&quot;;&lt;br /&gt;        format.size = 11;&lt;br /&gt;        format.color = 0xFFFFFF;&lt;br /&gt;        format.align = TextFormatAlign.CENTER;&lt;br /&gt;        format.bold = true;&lt;br /&gt;        &lt;br /&gt;        var child:TextField = new TextField();&lt;br /&gt;        child.y = 1;&lt;br /&gt;        child.width = _width;&lt;br /&gt;        child.height = _height;&lt;br /&gt;        child.selectable = false;&lt;br /&gt;        child.defaultTextFormat = format;&lt;br /&gt;        child.mouseEnabled = false;&lt;br /&gt;            &lt;br /&gt;        addChild(child);&lt;br /&gt;        return child;&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    public function setLabel(text:String):void {&lt;br /&gt;        label.text = text;&lt;br /&gt;        this._name = text;&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    public function setDescription(text:String):void {&lt;br /&gt;        description = text;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;    &lt;br /&gt;class CustomSimpleButton extends SimpleButton {&lt;br /&gt;    private var upColor:uint = 0xFFCC00;&lt;br /&gt;    private var overColor:uint = 0xCCFF00;&lt;br /&gt;    private var downColor:uint = 0x00CCFF;&lt;br /&gt;&lt;br /&gt;    public function CustomSimpleButton(_width:uint, _height:uint) {&lt;br /&gt;        downState = new ButtonDisplayState(downColor, _width, _height);&lt;br /&gt;        overState = new ButtonDisplayState(overColor, _width, _height);&lt;br /&gt;        upState = new ButtonDisplayState(upColor, _width, _height);&lt;br /&gt;        hitTestState = new ButtonDisplayState(upColor, _width, _height);&lt;br /&gt;        useHandCursor = true;&lt;br /&gt;    }        &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class ButtonDisplayState extends Shape {&lt;br /&gt;    private var bgColor:uint;&lt;br /&gt;    private var _width:uint;&lt;br /&gt;    private var _height:uint;&lt;br /&gt;&lt;br /&gt;    public function ButtonDisplayState(bgColor:uint, _width:uint, _height:uint) {&lt;br /&gt;        this.bgColor = bgColor;&lt;br /&gt;        this._width = _width;&lt;br /&gt;        this._height = _height;&lt;br /&gt;        draw();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private function draw():void {&lt;br /&gt;        graphics.beginFill(bgColor);&lt;br /&gt;        graphics.drawRect(0, 0, _width, _height);&lt;br /&gt;        graphics.endFill();&lt;br /&gt;    }&lt;br /&gt;}</description>
		<dc:creator>byyolyemez</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-02-20T07:39:36</dc:date>
	</item>
	</rdf:RDF>

