1 Reply Latest reply on Jul 12, 2011 10:32 AM by Scott R. Hamilton

    Control reference error, for no evident reason

    Scott R. Hamilton Level 1

      A module in my projects copies in an ActionScript file:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="718" height="974" backgroundColor="#FCF9EC">


          <mx:Script source="InsMenuMPEvt_MySQL.as"/>
          <mx:Script source="SqlQuery.as"/>


      This ActionScript code (in InsMenuMPEvt_MySQL.as ) references an object in the module:


              case "InsertMenu":
                  //tiInsRetCode.text = "OK"
                  if (event.result.results.error == "") {
                    tiInsRetCode.text = "OK";
                  else {
                    tiInsRetCode.text = "NOK";                   


      The compiler generates an error:


      1120: Access of undefined property tiInsRetCode.    InsMenuMPEvt_MySQL.as    /Culinaria/bin-release/src    line 81    Flex Problem


      although the property is defined in the module:


      <mx:TextInput height="22" width="54" id="tiInsRetCode" fontWeight="normal" fontSize="10" textAlign="center"/>


      This has been working for months and now for no reason that I can fathom, the compiler is generating this error and an error for every other reference to an object in a module that includes the ActionScript file.

        • 1. Re: Control reference error, for no evident reason
          Scott R. Hamilton Level 1

          This is getting crazier by the minute.


          I've been trying everything under the sun to get rid of this problem. I have removed a different Module from the Project->Properties->Modules screen, a module that has no reference to the variable flagged as not defined and now the .as file is not generating any compile errors.


          So in a nutshell:


          Module A  <mx:Script source="Src.as"/>  defines a text control wiith id="x"


          Module B  <mx:Script source="Src.as"/>  does not define a text control wiith id="x"


          Src.as references  control wiith id="x" generating a compiler error - 1120: Access of undefined property x.    Src.as


          If Module B is removed from the project's Module list there is no error!