Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-11-2003, 08:15 PM   #1
Leo Vildosola
Registered User
 
Join Date: Nov 2003
Posts: 4
Default Making Flash Remoting PSeudo-Synchronous

Flash remoting is asynchronous by nature. In order for a flash client to process results it is required to write two callback functions per service call or simply an onResult method for handling returned values and an onStatus method for error handling.

I don't want to have to create these methods all the time, so I created a base class in AS2 to support any service consumer. The class is called AbstractServiceConsumer. In this class I have onResult and onStatus methods to deal with the information being returned as a result of the remote call. I also have a property that stores the returned value for the last call onResult handled.

My goal is to create a layer over flash remoting that will allow me to simulate a synchronous call. I basically would like to make the service call, wait until the onResult is called, and access the property to get the value.

Eveything works fine until I have to wait for the onResult call. The problem I have is that I don't know how to force a wait or sleep of the current processing. I can't find any functionality that will allow me to do just that. I have looked into setInterval but I don't think it does what I need since it continues processing after the function is called.
Leo Vildosola is offline   Reply With Quote
Old 12-05-2003, 11:14 PM   #2
nitrofly
Registered User
 
Join Date: Dec 2003
Posts: 2
Default Re: Making Flash Remoting PSeudo-Synchronous

Quote:
[i]
Eveything works fine until I have to wait for the onResult call. The problem I have is that I don't know how to force a wait or sleep of the current processing. I can't find any functionality that will allow me to do just that. I have looked into setInterval but I don't think it does what I need since it continues processing after the function is called. [/B]
How about using myObject.watch( prop, callback [, userData] ) to watch for a property change in your instantiated responder objects? This could be initialized at the time the responder objects are instantiated.
nitrofly is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:31 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.