4 Replies Latest reply on Jun 20, 2009 12:55 AM by leybniz

    Two questions: scope and methology

    Jerry62712 Level 1

      I have two questions, both based on this code:

       

      public function accessibleSet():void {
          headerDHSImage.accessibilityProperties.description = 'State of Illinois Department of Human Services logo';
      }

       

      This is located in an .AS file that is ultimately called from the creationComplete event.  The object "headerDHSImage" is in a component called DHSHeader.mxml and it looks like this:

          <mx:Image id="headerDHSImage"
              source="images/DHSLogo.gif"
              toolTip="State of Illinois Department of Human Services Logo"
              left="5" top="5"/>

       

       

      What I want to do is programatically change the toolTip|description so that 1) it can be either in English or Spanish and 2) JAWS has something to read for 508 reasons.  Currently I get an error in the accessibleSet function of "1120: Access of undefined property headerDHSImage.".

       

      I'm sure that part is just plain ignorance on my part of how to address it correctly.  The second part of this is is this the correct way to set a description and should I be using a description in the first place.

       

      Any help would be greatly appreciated.

        • 1. Re: Two questions: scope and methology
          leybniz

          First thing you should digg in is a ResourceManager, this  guy will solve your localization problems (English + Spanish)

          next one, you'd better put your accessibleSet()

          function inside mx:Script tag inside DHSHeader.mxml

          • 2. Re: Two questions: scope and methology
            Jerry62712 Level 1

            Shoot.  That routine will have to set the accessibility stuff in the DHSFooter as well.  Since I can change the values in the third component (switching the values of the labels from one to the other language) I didn't think you couldn't change a label in a component except from within that component.

             

            And I was going to expand it one more time to have that function call the xml reader class that will take an input parm in xml format and extract the data for processing.  Not only is this a requirement, but it seems like a good testing tool as well.  We change our standards tables two times a year and need to make sure the rest of the program still works correctly.

            • 3. Re: Two questions: scope and methology
              Jerry62712 Level 1

              Update.

               

              As I access other components (well, one) and change the value based on the language being used, I figured this wouldn't be hard.  I got some of it figured out now and am going to relate it incase anyone else has the problem and to make sure I'm approaching it right.

               

              Landscape:

              three general components (mxml files)

              one main file (mxml)

              several .AS files included via a script tag to that main file

               

              Problem:

              I need to change the text depending on the language being selected (currently English and Spanish).

              I need the text to be "visible" for accessibility (JAWS) technologies.

               

              Solution:

              In the application tag have this:

              <mx:Application
                xmlns:mx="http://www.adobe.com/2006/mxml"
                xmlns:DHSComp="components.*"
                creationComplete="setInitAccessible();"

               

              and have this:

                  <DHSComp:DHSHeader id="headerComp" />

               

               

              In the .AS file import the components:

              import components.*;

               

              and have this:

                  headerComp.headerDHSImage.accessibilityProperties.description = 'text goes here';

               

              I don't know if the description is the 508 way to go or not.  Perhaps the toolTip is enough, I just don't know.  But I do know something is needed for 508 and we have to accomodate different languages.  You can be blind in Spanish as easy as English.  That of course is part two of the two questions I had on this subject.

              • 4. Re: Two questions: scope and methology
                leybniz Level 4

                ok, here we go..

                 

                as I mentioned to you earlier, ResourceManager class will do the magic for you, but you have to setup a lot of things to make it work, here are the steps:

                 

                1. You should make your choice how to name the Spanish locale 'es_ES, es_AR' or you could go with both of them, to be able to make a distinction from US Spanish and Native Spanish. As well you'll have 'en_US' locale intact, so you have chosen 3 locales to be used.

                 

                2. Create locale folders structure at the root of your project

                locale\en_US

                locale\es_ES

                locale\es_AR

                and let your project to know this location by putting 'locale\{locale}' string in Project Properties > Flex Build Path > SourcePath > Add folder: locale\{locale}

                 

                3. Configure compiler arguments as follows: Project Properties > Flex Compiler > Additional compiler arguments: -locale en_US es_AR es_ES -allow-source-path-overlap=true

                apply settings, and if you have auto-build turned on you'll have some errors regarding 'es_AR', 'es_ES'

                 

                4. Next thing is to propagate unfamiliar locales with Flex SDK, mine 3.4 SDK tells me 'es_AR', 'es_ES' unknown to him

                navigate to SDK\Bin folder and execute following commands

                'copylocale en_US es_AR'

                'copylocale en_US es_ES'

                this will copy sdk properties stuff to your new locale.

                 

                5. At this point you are ready to add resource bundles, what is that?

                http://livedocs.adobe.com/flex/3/html/help.html?content=l10n_6.html

                 

                you should put all accessibility texts into appropriate resource bundles as well.

                1 person found this helpful