A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Accessiblity through actionscript, possible?

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    20
    Hi everybody,

    I'm fascinated with the new accessibility features of Flash. Don't know why. I'm not blind and I don't know blind people, but that's a different story.

    You can add text to objects through the accessiblity panel, so special screenreaders can read the text out loud. This is all fine, if your timeline oriented. But most of my sites are totally dynamic actionscipt. They even construct the screen through XML files send by the back-end. Just to get things in the context. I have sites pulling up thousand different pages on a regular day. The content changes on a daily basis. So you can imagine, that I don't want to or even can afford to copy and paste into the accessiblity panels.

    We have learned for years, that you have to seperate content from presentation (visual, audio, PC, pocket PC, SMS, etc.). It kinda strikes me as odd that it is not the case with the accessibility features, is it. Please prove me wrong!

    Any help is appreciated


    Jan

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    218
    The Accessibility object alone is a pretty superficial way to make your site accessible, but it's there. Most of the work is in creating custom tab-order functionality to guide text readers through your site's main navigation and text. The good news is if you're using dynamic text fields, they are automatically labeled.

    The best thing to do would be to write a class that detects if Accessibility.isActive == true, and makes available a few reusable methods. I've tried to write a class that does this below.

    THIS IS UNTESTED:

    Code:
    
    
    /*  Accessible Class
        2003 Mike Britton
    */
    
    function Accessible(enabledArray, view) {
        this.enabled = enabledArray;
        this.view = view;
        this.length = this.enabled.length;
        if (this.Accessibility.isActive == true && System.capabilities.hasAccessibility == true)
            this.init();
    }
    
    Accessible.prototype.init = function() {
        trace("Accessibility is enabled.  Fire up that screen reader");
        for (i=0; i<=this.length; i++) {
            this.enabled[i].tabEnabled = true;
            this.enabled[i].tabIndex = i+1;
        }
    };
    
    Accessible.prototype.getFocus = function(target) {
        this.target = target;
        Key.addListener(this);
    };
    
    Accessible.prototype.onKeyUp = function() {
        if (! Key.isDown(Key.SHIFT)) {
            if (Key.getCode() == Key.TAB) {
                Key.removeListener(this.target);
                this.setFocus(this.target);
            }
        } else {
            Key.removeListener(this.target);
        }
    };
    
    Accessible.prototype.setFocus = function(n) {
        Selection.setFocus(n);
    };
    
    Accessible.prototype.setTab = function(target) {
        this.target = target;
        this.getFocus(target);
    };
    
    Paste this to the stage:

    Code:
    #include "Accessible.as"
    
    // The instance names
    allAccessible = [firstField, secondField, thirdField];
    this.access = new Accessible(allAccessible, this);
    
    depth = 0;
    y = 20;
    
    this.createEmptyTextField("firstField",depth++,20,y*depth++,300,100);
    this.createEmptyTextField("secondField",depth++,20,y*depth++,300,100);
    this.createEmptyTextField("thirdField",depth++,20,y*depth++,300,100);
    
    this.firstField.onSetFocus = function() {
        this.access.SetTab(this.firstField);
    };

    Rememeber, this is untested code, but it's is something like what needs to be done. I'll play with it in Flash and post back here, but this should give you an idea of what needs to be done to address accessibility. You could even go so far as to load a few simple mp3's to orient the blind user.

    Unfortunately, because Flash 6 seems to only support the MS screen reader, it may only work with that. My goal is to address government mandated section 508 compliance, but it looks like this may have to wait another player version. Still, I am working on a search engine for the US government's toxicology program that requires a much more dynamic interface than what a standard web interface can provide. I'm dying to use Flash for this software, but section 508 mandate requires I build within 508 accessibility guidelines. So here I am, I suspect with many other people who would like a few Macromedia endorsed code examples for dynamic accessibility to build on. Or how about a component?!



    Mike Britton

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    218
    Found this, inresponse to another thread I'm subscribed to on the subject:

    http://www.macromedia.com/support/fl.../rn_6.html#new

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    218

    new thread at Macromedia

    I'm kicking some of this around on a thread on the MM forums, if anyone's interested. Not a lot of code (yet), but some good informational leads on _accProps and using a few undocumented fields of _accProps to assign dynamic Accessibility properties:

    A thread on Accessibility at Macromedia

  5. #5

    where is it?

    Hi All!

    I've actually tried utilizing the Hi-Caption Viewer Component distributed by HiSoftware.

    But I haven't come across any reader (JAWS, Window-Eyes) that reads off of Flash MX 2004.

    Getting a bit fustrated. Have you guys been able to get this working?

    Thanks!
    Patrick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center