2 Replies Latest reply on Jan 7, 2010 6:00 AM by Jerry62712

    How do I access a script?

    Jerry62712 Level 1

      I have a component that includes a script file. That file has a single function. I included the script file as an include in a component, but I can't execute the function in that component. Probably a simple mistake, but I'm not seeing it.

      Here is the relevant part of the component:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
           borderStyle="outset" borderThickness="2">

      <mx:Script source="../ASFiles/AccessibleScriptsDT.as"/>

      ==>          dtAccessibility();

      File AccessibileScriptsDT.as starts with:


      public function dtAccessibility():void {
           if (CONTACTNAME.accessibilityProperties.name == "Contact Name")
                return;          // already been here

           // establish accessibility ************************************************
           dtHeader.accessibilityProperties = new AccessibilityProperties();
           btnDTSaveRecord.accessibilityProperties = new AccessibilityProperties();
           btnDTNewRecord.accessibilityProperties = new AccessibilityProperties();
           btnDTResetForm.accessibilityProperties = new AccessibilityProperties();

      The error on the function is:

      1180: Call to a possibly undefined method dtAccessibility.
        • 1. Re: How do I access a script?
          pauland Level 4

          It looks as though you are writing "inline" code in the script

          block. All executable code must be wrapped in a function typically people have an init() function called on creationComplete.



          • 2. Re: How do I access a script?
            Jerry62712 Level 1

            Sorry for my slow reply.


            I was able to add a "creationComplete" to the component object that did the function (sort of - see below).  I also tried adding an execution where the state is changed to the new form.  This also worked.  As I don't want to execute this any more than necessary, I like your suggestion better.  Apparently, once a state is called, that component is permanently invoked and there is no need to reset the stuff.


            By "reset the stuff" I'm talking about the purpose of the function.  That is the "see below" I was talking about.  The function of this is to set the accessibility options so JAWS can read the forms.  While I said "options", it appears that Flex only has one option, that of "name".  "Description" doesn't seem to be used in Flex despite it being there in the language and in the documentation.


            The problem becomes that even with the "name" accessibility property set, I still don't hear anything.  But that is for another thread.