Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?

2010-01-13 Thread Tim Romano

Tracy,
Yes.  Thanks for the info.
Tim

On 1/13/2010 12:51 AM, Tracy Spratt wrote:


You are using Firefox, I bet.  I have sent this behavior and I think 
it is just a bug in FF.


Tracy Spratt,

Lariat Services, development services available


  The status bar says Transferring data from localhost... and that 
status message never goes away. sn ip




RE: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?

2010-01-12 Thread Battershall, Jeff
Tim,

Maybe I'm missing something here, but to my understanding when the result event 
of your HTTP service fires, your call IS complete.  You should have access to 
the json string that was pulled back from the service.  Is there something else 
you need that the json string doesn't' supply?

Jeff

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Tim Romano
Sent: Tuesday, January 12, 2010 2:53 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] HTTPService Responder ResultEvent -- how to know when the 
JSON data sent via HTTP are complete?




I started learning FlashBuilder/Flex by diving in and writing an AIR 
application against SQLite with asynchronous connections and Responder objects. 
The responder's resultsHandler is passed a flash.data.SQLResult object that 
exposes a complete status property.  Lovely.

Now I am trying to rewrite that AIR application as a browser-deployed Flex app 
using an HTTPService against a RESTful webservice that returns JSON data. The 
webservice is working, and the Flex HTTPService is pulling the JSON string 
down, but there doesn't seem to be anything analogous to the complete 
property that was available with the asynch data connection in the AIR app.  
Not so lovely.

The result-handler specified in the HTTPService responder has two parameters, 
the ResultEvent and the AsyncToken. The ResultEvent exposes a statusCode 
property. The result-handler can be called more than once. The 
ResultEvent.statusCode = 200 each time the handler is called. How do you know 
when the remote data are complete?

I will keep googling as I'm sure this question must be commonplace, but so far 
I haven't found the answer.

Thanks for the help.






Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?

2010-01-12 Thread Tim Romano
Jeff,
Thanks for the reply. I am confused by the behavior of my Flex app. The status 
bar says Transferring data from localhost... and that status message never 
goes away. But, as you suggested, the data are complete:  I pop the raw JSON 
string returned by the webservice into a TextArea, and it's all there, a string 
literal representing an array of objects:[{...},{...},{...}], and the 
string literal decodes into a well-formed ActionScript array.

Is there something my results-handler has to do to clear that status message?
Tim


  


  Maybe I’m missing something here,
but to my understanding when the result event of your HTTP service fires, your
call IS complete.  You should have access to the json string that was
pulled back from the service.  Is there something else you need that the
json string doesn’t’ supply?

RE: [SPAM] Re: [flexcoders] HTTPService Responder ResultEvent -- how to know when the JSON data sent via HTTP are complete?

2010-01-12 Thread Tracy Spratt
You are using Firefox, I bet.  I have sent this behavior and I think it is
just a bug in FF.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Tim Romano
Sent: Tuesday, January 12, 2010 4:31 PM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] HTTPService Responder ResultEvent -- how to
know when the JSON data sent via HTTP are complete?

 

  

Jeff,
Thanks for the reply. I am confused by the behavior of my Flex app. The
status bar says Transferring data from localhost... and that status
message never goes away. But, as you suggested, the data are complete:  I
pop the raw JSON string returned by the webservice into a TextArea, and it's
all there, a string literal representing an array of objects:
[{...},{...},{...}], and the string literal decodes into a well-formed
ActionScript array.

Is there something my results-handler has to do to clear that status
message?
Tim

  

 

  Maybe I'm missing something here, but to my understanding when the result
event of your HTTP service fires, your call IS complete.  You should have
access to the json string that was pulled back from the service.  Is there
something else you need that the json string doesn't' supply?