1 Reply Latest reply on Dec 5, 2007 8:10 AM by riafan

    getChildByName / getChildAt returning NULL

    riafan Level 1
      var o:Object = new form1();
      ...
      o.getChildByName("foo") returns NULL.

      However, I *can* drill down to the childDescriptors of "o" in the debug
      window. I do see "foo" therein.


      The call to o.getChildByName() was working until o became a
      AS3 variable. Prior to this, o's parent was an MXML tag & everything
      worked.

      Any thoughts???
        • 1. Re: getChildByName / getChildAt returning NULL
          riafan Level 1
          Using callLater() seems to have fixed this behavior.

          I dynamically created var f:Object = new form1();

          I then call a recusive function on f, f.GetData()

          o is found a 1-2 levels of recursion (a canvas that's in an accordion that' in the canvs, f)

          So perhaps the call to updateDisplayList,etc had't yet worked their magic and created all of the nested components (namely o's childern). The debugger, however had.

          Calling callLater() before the recursive call, f.GetData() seems to have fixed this problem.

          Interesting.