Because data calls are asynchronous, you can't use the result in the same function that you call it, you must do it in a result handler.
Put this line in the result handler function: var posterdata = posterinfo_srv.result.posters.poster; Tracy -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Manu Juyal Sent: Monday, August 15, 2005 1:05 PM To: [email protected] Subject: Re: [flexcoders] array question. Tracy, I am still not able to get the results. following is my HttpService and below that is the XML code and function reading results from the service ...... <mx:HTTPService id="posterinfo_srv" url="http://xxxxx/xxxx.php" fault="faultHandler(event.fault.faultstring, event.fault.faultcode)" method="POST" showBusyCursor="true" useProxy="false" /> ....... it returns following XML <posters> <poster> <firstname>xxx</firstname> <lastname>xxxx</lastname> </poster> <poster> <firstname>yyyy</firstname> <lastname>yyy</lastname> </poster> <posters> function popInvoice(sessionid){ posterinfo_srv.send({query_type:'getposterinfo_sessionid2', sessionid: sessionid}); posteradminstack.selectedChild = invoicepanel; var posterdata = posterinfo_srv.result.posters.poster; lbl_fname.text = posterdata[0].firstname; lbl_lname.text = posterdata[0].lastname; lbl_date.text = posterdata[0].date; } On 8/12/05, Tracy Spratt <[EMAIL PROTECTED]> wrote: > If your resultFormat is xml or object, and there is an array in the data > returned, there will be an array in the result object. The trick is > finding it. When you do you can assign it directly to the variable. > > Do you know exactly what the httpservice is returning? Use a result > event handler and a debugger to inspect the result object. > > If result format is object, the default, then you will dot down to the > array. If it is xml, you will use the xml api to nav to the data, then > use childNodes to return the array. > > Tracy > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of juyalmanu > Sent: Friday, August 12, 2005 4:43 PM > To: [email protected] > Subject: [flexcoders] array question. > > Hi all.. > I am trying to call a httpservice to fetch some data. Basically this > data will be in the form number of records from database. Then I want > to populate this data "NOT" in a datagrid but in some kind of form. > > Can anyone please help me with how can I assign get data from the > httpservice results to some array variable. > > > thanks > > > > > > -- > 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 > > > > > > > > > > > -- > 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 > > Visit your group "flexcoders" on the web. > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > ________________________________ > -- 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hin8335/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124134306/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

