0 Replies Latest reply on Mar 5, 2009 9:02 AM by mtgna

    Detecting change in ArrayCollection

    mtgna Level 1
      Hi

      How do I add an eventlistener to detect when my ArrayCollection is populated?
      For instance I have used ChangedWatcher but the function createdg doesnt fire:


      //populating ledgerdata with dummy AC otherwise error msg about empty variable
      model.ledgerdata=model.chartofaccounts;

      mx.binding.utils.ChangeWatcher.watch(model.ledgerdata,"length",createdg);

      //dispatch event to populate model.ledgerdata with data
      var ev: GetLedgerEvent = new GetLedgerEvent();
      ev.acccode = acccode.text;
      CairngormEventDispatcher.getInstance().dispatchEvent( ev );




      }
      public function createdg(event:Event):void{
      Alert.show("yes");

      I have also tried model.ledgerdata.addeventlistener without any success.

      Can someone advise?

      Thanks