1 Reply Latest reply on Nov 26, 2013 12:02 PM by Jbarrett

    Event listener troubles

    Jbarrett

      I'm rather new to flash builder, as I am editing an app that was contracted made offshore.  I have added a new service but my listener never hits,  I used fiddler to see that it successful querys the webservice but the success (or failure) events never fire. 

       

      protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void

      {

       

      var serviceManager:Refer_EarnServiceManager = new Refer_EarnServiceManager();

      serviceManager.addEventListener(Refer_EarnWebServiceEvent.RECOMMENDED_BUSINESS_SERVICE,onR ecommendedBusinessSuccess);

      serviceManager.addEventListener(FaultEvent.FAULT,onRecommendedBusinessFail);

      serviceManager.getRecommendedBusinesses( BusinessVO(data).intBusinessID); // BusinessVO(data).intBusinessID

      showBusy();

       

      }

       

       

       

       

      private function onRecommendedBusinessSuccess(event:Refer_EarnWebServiceEvent):void

      {

      hideBusy();

      //AppModel.getInstance().recommendedbusinessList = event.result

      var arrcol:ArrayCollection = Refer_EarnWebServiceParser.parseRecommendedBusinessResult(event.result);

      appModel.recommendedbusinessList = arrcol;

      if(arrcol.length>1)

      {

       

      // navigator.pushView(Refer_EarnChooseBusiness2,arrcol);

      hideBusy();

      }

      else

      {

      // navigator.pushView(Refer_EarnMainView,arrcol[0] as BusinessVO);

      hideBusy();

      }

      }

        • 1. Re: Event listener troubles
          Jbarrett Level 1

          Found the answer:  There was a "dispatch" function that I missed.

           

           

           

           

          case ApplicationConstants.WEB_SERVICE_RECOMMENDED_BUSINESS:                     {                          dispatchEvent(new Refer_EarnWebServiceEvent(Refer_EarnWebServiceEvent.RECOMMENDED_BUSINESS_SERVICE,xmlObj)) ;                          break;                     }