2 Replies Latest reply on Jan 5, 2007 11:58 PM by sf_dougco

    getting dataProvider information on creation or initialize

    sf_dougco
      I am creating a graphing application fashioned from the "dashboard" example from adobe, and I want to do some dynamic line creation which works fine if I hard wire it. But I want to base the generation on things from the dataProvider source. I have this code:

      public function initUnits():void {
      var tt:Object = unitlines.dataProvider;
      trace(tt.length);
      }

      and

      <mx:LineChart dataProvider="{dataPoints}" showDataTips="true" id="unitlines" width="100%" height="100%" dataTipFunction="formatDataTip" creationComplete="initUnits()">

      Here's the odd thing -- the init function returns zero length, but if I postpone that routine until, let's say, the tip function gets called, then the length is correct. So, it seems that the dataProvider object is not getting fully set before the lineChart component calls my init routine!

      How can I get this so my init routine is called after the dataProvider object has it's data ??

      I have tried "initialize" instead of creationComplete, and also have tried both in the top level <mx statement

      Thanks