If you use the IResponder interface you can do this very easily.
IResponder requires you to implement 2 methods.

public function result(data:Object):void
public function fault(info:Object):void

So what you can do is create however many classes you want that
implement the interface, and then call your method like this:

var call:AsyncToken = GroupWS.GetMembers.send();
call.addResponder(implementerOne);
call.addResponder(implementerTwo);

For handling web service calls, you'll be receiving ResultEvent and
FaultEvent objects, so you can do this inside the methods:

var event:ResultEvent = data as ResultEvent;
var event:FaultEvent = info as FaultEvent;

HTH,
Ben
http://www.returnundefined.com/


--- In flexcoders@yahoogroups.com, "ldyhwke24" <[EMAIL PROTECTED]> wrote:
>
> 
> Hi all,
> 
> Just a small question, I've been playing around with - is it possible to
> set the result of a method dynamically?  Depending on whose calling the
> method?  I'd like to use one method to populate two different datagrids.
> 
> i.e.
> 
> private function CurrentUsers():void {
>      //Current Users
>      MemberTypeId = 0;
>      Group = 2;
>      HistoricalMembership = false;
>      GroupWS.GetMembers.send();
> 
>    //set result method here..??
>     }
> 
> 
> <mx:WebService id="GroupWS"
>     wsdl="http://localhost/Group.asmx?WSDL <http://GroupWS.asmx?WSDL> "
>      useProxy="false"
>     showBusyCursor="true"
>     fault="Alert.show(event.toString())">
> 
>    <mx:operation name="GetMembers" result="<can this be set
> dynamically?>">
>     <mx:request>
>      <MembershipTypeID>{GroupMemberTypeId}</MemberTypeID>
>      <HistoricalMembership>{HistoricalMembership}</HistoricalMembership>
>      <Group>{Group}</Group>
>     </mx:request>
>    </mx:operation>
> 
>   </mx:WebService>
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to