2 Replies Latest reply on Mar 31, 2008 8:18 AM by ntsiii

    referencing variable from class file to controls

    user341975
      I am modifing an existing application. I have the class file. I am using <MX:SCRIPT> to reference the class object in the mxml file.
      Now i would like to assign the value from class file variable to the data control.

      Please let me know how i can achieve this.
        • 1. Re: referencing variable from class file to controls
          Sreenivas R Adobe Employee
          The code of in the AS file referred in the script tag would get inserted into the main AS file generated for the mxml file. You can refer to any variable function in the AS source file directly in MXML.
          • 2. Re: referencing variable from class file to controls
            ntsiii Level 3
            A clarification here: You cannot "include" a "class" file using the mx:Script source="" declaration.

            If you include an AS script file, it cannot be a class, but must be simply script statements. If you try to include a class, you will get errors about nested classes.

            If you really have a class file you want to use, instantiate it using an mxml tag, or the "new" keyword in AS. It becoames a component, and you cannot directly access its scope from outside, but will need to use standard data passing techniques.

            Tracy