2 Replies Latest reply on May 30, 2007 4:49 AM by mouse jockey

    Data binding question

    mouse jockey Level 1
      My main application utilises a popup window component (a titlewindow in a separate file). Once opened, the popup contains a datagrid whose dataprovider is defined as a bindable public var array in a separate AS file. This gives me a '1120 access of undefined property' error.

      How can I get the datagrid to 'see' the bindable data please?
        • 1. Re: Data binding question
          BLXWebMaster Level 1
          Can you post your code?

          Are you missing a ";"?

          • 2. Re: Data binding question
            mouse jockey Level 1
            From my research, meanwhile, I think I need a reference variable.

            Here's the plot so far:

            ---------------------------------------------------------------------
            Main mxml file contains

            <script source="/scripts/keyboard.as"/>
            <script source="/scripts/mysql.as"/>

            mxml stuff ........ etc. ....

            ---------------------------------------------------------------------

            MXML titlewindow component file (used for popup), and called from main mxml file, contains datagrid with dataprovider = "{MySQLDataArray}"

            ---------------------------------------------------------------------


            but MySQLDataArray can't be seen in the component file (it lives in the mysql.as file). I understand that I can add a bindable local variable thus is the titlewindow component file with:

            <mx:Script>

            [Bindable]

            private var localVar:Array;

            </mx:Script>

            and change the datagrid dataprovider to dataprovider = "{localVar}"

            but how do I get the localVar to reference the MySQLDataArray variable in the mysql.as file?