I shouldn’t have been so whiney, this turned out to be easier than I thought, doing just what I said below, using an array to track completion of a queue of external calls.

 

The event.call token/dynamic property technique is hugely powerful. Strangely, I can’t seem to get an uncorrupted copy of the Chapter 20 pdf. I’ll keep trying.

 

Thanks for the help!

Tracy

 


From: Tracy Spratt [mailto:[EMAIL PROTECTED]
Sent: Friday, April 30, 20048:34 PM
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] "wait loop" to synchronize asyncronous call?

 

My service event handler is working fine, using event.call properties to send the result to the correct component instance.

 

But I have a procedural path that tries to use the returned data before it arrives. Essentially I am building an arrayof data from several sources, that may or may not be external

 

If I can’t do a wait or sleep or pause, I will have to do detect if there are any external servicecalls, request them first, storing an array of requests somewhere, decrementing the array when each data call returns, and finally doing my local processing when all the calls are returned.  Plus I want them in the order I request them. Yikes!  Well if it was easy, I wouldn’t be making the big bucks!

 

Thanks,

Tracy

 


From: Matt Chotin [mailto:[EMAIL PROTECTED]
Sent: Friday, April 30, 20047:49 PM
To: 'flexcoders@yahoogroups.com'
Subject: RE: [flexcoders] "wait loop" to synchronize asyncronous call?

 

Hi,

 

The Flash Player doesn't support a threading model like you're looking for.  There is only one thread for ActionScript code.  So if the processing you're talking about is on the server what you'll do is call your service, then place any code that depends on that service having completed in some function that will be called by your service's result handler.  You can also put up a shim to block all user-interaction in the meantime if the busy cursor isn't enough.  I think we have an example of that in our extras folder.

 

Matt

 

-----Original Message-----
From: nts333rd [mailto:[EMAIL PROTECTED]
Sent: Friday, April 30, 20044:29 PM
To: [EMAIL PROTECTED]
Subject: [flexcoders] "wait loop" to synchronize asyncronous call?

 

I'd like to set up a loop that will block current processing until
some condition is met.

setInterval, and the various timers I see onthe forums allow one to
run some function after some interval for animation effects and
such.  But I need an implementation that will allow me to do
something like:

.....
do{
  //just wait
}(while mycomponent.isDataReady == false)   //DOES NOT WORK

processData(myComponent.getData);
...

Any suggestions?

Thanks,
Tracy

 

 

Reply via email to