ok,
so what you are asking here is how can I have two instances listen
out to an event dispatched from another instance and only respond if
it was the one that triggered the event (albeit asynchronously)
a quick solution would be to add a reference to the calling class in
the original call, and test for that in the return;
remotingClass.getInstance().getResults(this,someOtherData);
in the remoting class:
function getResults(originator,someOtherData){
//make request
request.onResult = function(){
dispatchEvent({type:"aResult", originator:originator})
}
}
//in the listening class:
function onAResult(eventObj){
if(eventObj.originator==this){
/do stufff
}
}
On 1/9/06,Steven Sacks <[EMAIL PROTECTED]> wrote:
> I want to add that what I've got is two identical clips that do the same
> exact thing but they each need to make their own remoting call with their
> own arguments being passed to the server, and they're going to make the
> request at the same time sometimes. I need a way to track which request
> goes with which requester. I won't be getting anything back from the server
> that tells me which it is supposed to go to.
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Steven Sacks
> > Sent: Monday, January 09, 2006 5:01 AM
> > To: 'Flashcoders mailing list'
> > Subject: [Flashcoders] Multiple Remoting Event Listeners
> >
> > I have a class that I'm using to make remoting calls. When a
> > result comes
> > back, it dispatches an event passing the result.
> >
> > Sometimes, one of the remoting calls will go out to multiple
> > listeners but
> > only the one who made the request should handle the result
> > event, the other
> > will ignore it unless it was the one who request it. What is
> > the best way
> > to handle this?
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders