3 Replies Latest reply on Jan 29, 2009 7:57 AM by Newsgroup_User

    bizzare component behavior

    bmilesp Level 1
      Hello,

      I have created a custom component called a ChartCell based off a tilelist. I have a SuperPanel (from http://www.wietseveenstra.nl) with a viewstack and a tabbar, with 4 types of ChartCells inside (see code below).
      I retrieve data from an external xml file and sort the data based on types (in this case, glyph_form_type_id) into each ChartCell using the populatePanels function.

      the problem: if I only supply the first ChartCell with data, (therefore, commenting out the other addItem methods in populatePanels as illustrated below) everything works as expected. But if i uncomment any other addItem (eg: graphemes.dataProvider.addItem(i);) then a "cannot access a null reference" error is thrown in the debugger. What completely baffles me is, in the debugger->variables tab, the first chartCell (phonemes) has a value of ChartCell, but the others (graphemes, allophones, and sources) have a value of null! How can this be possible? I've been banging my head over this for hours, please help! (and let me know if you need any other information) Thanks in advance

        • 1. Re: bizzare component behavior
          Level 7

          "bmilesp" <webforumsuser@macromedia.com> wrote in message
          news:glrkcs$4ku$1@forums.macromedia.com...
          > Hello,
          >
          > I have created a custom component called a ChartCell based off a tilelist.
          > I
          > have a SuperPanel (from http://www.wietseveenstra.nl) with a viewstack and
          > a
          > tabbar, with 4 types of ChartCells inside (see code below).
          > I retrieve data from an external xml file and sort the data based on types
          > (in
          > this case, glyph_form_type_id) into each ChartCell using the
          > populatePanels
          > function.
          >
          > the problem: if only supply the first ChartCell with data, (therefore,
          > commenting out the other addItem methods in populatePanels as illustrated
          > below) everything works as expected. But if i uncomment any other addItem
          > (eg:
          > graphemes.dataProvider.addItem(i);) then a "cannot access a null
          > reference"
          > error is thrown in the debugger. What completely baffles my is, in the
          > debugger->variables tab, the first chartCell (phonemes) has a value of
          > ChartCell, but the others (graphemes, allophones, and sources) have a
          > value of
          > null! How can this be possible? I've been banging my head over this for
          > hours,
          > please help! (and let me know if you need any other information) Thanks in
          > advance

          http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf Q5

          You may also find this example useful for other things you're doing:
          http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html


          • 2. Re: bizzare component behavior
            bmilesp Level 1
            excellent- thank you Amy, you've saved me over and over again! -b
            • 3. Re: bizzare component behavior
              Level 7

              "bmilesp" <webforumsuser@macromedia.com> wrote in message
              news:glsib6$asq$1@forums.macromedia.com...
              > excellent- thank you Amy, you've saved me over and over again! -b

              You're welcome :-)