>Of course, as you illustrate, this will not work if you are calling
>multiple methods on myService
 
Any clues as to whether multicasts are in the spec for AS?
 
Thanks,
Rich


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sho Kuwamoto
Sent: 24 March 2006 17:25
To: [email protected]
Subject: RE: [flexcoders] What happened to mx.utils.Deletage?

Hi Chris.

Roughly speaking, you do something like this:

myService.someMethod(arg1, arg2);
myService.addEventListener("result", resultMethod);

Of course, as you illustrate, this will not work if you are calling
multiple methods on myService, because you need a way of figuring out
which method you are getting the result for. As far as I know, you need
to do some of your own plumbing to make this happen.

Here is one way to do it:

function initializeStuff() : void
{
      myService.addEventListener("result", resultHandler);
}

function doStuff() : void
{
      var call = myService.someMethod(arg1, arg2);
      call.resultHandler = actualResultHandler;
}

function resultHandler(event: ResultEvent) : void
{
      var call : Object = event.call;

      if (call.resultHandler != null)
      {
            call.resultHandler.call(null, event)
      }
}

function actualResultHandler(event: ResultEvent) : void
{
}

-Sho


--
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




Reply via email to