1 Reply Latest reply on Mar 26, 2008 10:29 AM by Gaurav J

    How to get ArrayCollection length in initial function?

    mark416 Level 1

      I am working for conver Application form Flex 2 to Flex 3.

      I have the following code,I can see in the dataGrid and ArrayCollection length in the label "loopNumber",but why I can not get ArrayCollection length in initPage() for Flex 3 and the loop doesn't work.

      But I can get ArrayCollection length in initPage() in Flex 2.

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" ... creationComplete="initPage()">

      import ....;
      import ....;

      private var modelLocator:AdminModel = AdminModel.getInstance();

      private function initPage():void{


      for ( var j : int =0; j <modelLocator.acProcess.length ; j++)



      <mx:DataGrid x="42" y="64" id="proceeList" dataProvider="{modelLocator.acProcess}" width="300" updateComplete="initPage()">
      <mx:DataGridColumn headerText="Bursary Online" dataField="processName"/>

      <mx:Label id="loopNumber" x="32" y="428" text="{modelLocator.acProcess.length}"/>