views:

23

answers:

2

i've designed a UI in Flash IDE, have exported a lot of the objects for ActionScript, and program the application with an external document class .as file.

in Flash IDE, i don't want any of my sliders or textFields to have accessibility options. i open the Accessibility panel (Window > Other Panels > Accessibility), and with the stage selected i uncheck "Make Movie Accessible". save. compile. runtime error:

~/myCustomClass.as, Line 4 1180: Call to a possibly undefined method AccessibilityProperties.

line 4 is a simple import:

import flash.display.Sprite;

how can i solve this?

UPDATE:

adding the following imports to my .as removes the runtime error:

import flash.accessibility.AccessibilityProperties;
import flash.accessibility.Accessibility;

however, the application still allows tabbing. how can i completely turn off accessibility?

i've tried:

Sprite.prototype.tabEnabled = false;

but this didn't work.

A: 

Hi there,

try:

stage.tabEnabled = false;
stage.tabChildren = false;

Because every display object is a child of the stage, it should stop it globally.

UPDATE:

Because you can't set the tabEnabled property on the stage, you can loop over all the children on it and apply it to them.

for(var:int; i < stage.numChildren; i++) {
    var c:DisplayObject = stage.getChildAt(i);

    if(c is InteractiveObject) {
        InteractiveObject(c).tabEnabled = false;
    }

    if(c is DisplayObjectContainer) {
        DisplayObjectContainer(c).tabChildren = false;
    }
}
Tyler Egeto
didn't work. i received a runtime error for trying to set the stage with the tabEnabled property. it accepted tabChildren but it still allows me to tab.
TheDarkInI1978
Can you post the error? I just did a quick test and it work as I expected, no errors.
Tyler Egeto
Error: Error #2071: The Stage class does not implement this property or method. at Error$/throwError() at flash.display::Stage/set tabEnabled(). it also states in the documentation that an IllegalOperationError will be thrown if tabEnabled is set on the stage: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html
TheDarkInI1978
hmm strange, okay I'll update my answer with alternate solution.
Tyler Egeto
+1  A: 

Stage won't work , but you should be able to do it with root. In the Flash IDE , on the main timeline, add this:

var main:MovieClip = this.root as MovieClip();
main.tabEnabled = false;
main.tabChildren = false;
PatrickS
thanks, this worked. i just had to add this.tabChildren = false; to my main document class.
TheDarkInI1978