0 Replies Latest reply on Jul 9, 2010 1:43 PM by _H_P_

    Passing parameters between functions and result handlers

    _H_P_

      Hello,

       

      I have a function fooA(valueA1, valueA2) which calls web method myWSA(). Upon reeiving the result, it invokes a result handler which inturn calls another web service myWSB(value2). I want to know how I can pass/access this value2 into foo2. These values: value1 and value2 are dependent on the button clicled.

       

      private function fooA(valueA1:int, valueA2:int){
           callResponder.token = myWSA(valueA1);
      }
      
      private function myWSA_resultHandler(event:ResultEvent ) {
           myWSB(value2); //----------> I want to use the parameter, value2, passed in fooA here.
      
      }
      
      
      <fx:Declarations>
      <s:WebService id = "myWebService"
                            wsdl = "http://MyWebService?wsdl"
                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)">
                  <s:operation name = "myWSA"
                               result= "myWSA_resultHandler(event)"/>
                  
      </s:WebService>
      <s:CallResponder id = "callResponder" />
      </fx:Declarations>
      
      <s:Button id = "button1"
                label="Button1"
             click = "fooA(val1, val2)"/>
      <s:Button id = "button2"
                label="Button2"
             click = "fooA(val3, val4)"/>