There's not going to be any data in there immediately after you call send() - you need to wait (and listen) for the ResultEvent.RESULT event to occur.
-Josh On Mon, Jul 14, 2008 at 1:27 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have a box in one state, I remove the box and then add another box. > I do this so when the box is complete, I have something to trigger > getting data from an xml file. (That doesn't seem right, is there a > better way to trigger a function on entering a State ? ) > > I'm testing the data in 2 ways, 1 works and the other doesn't. > the HTTPservice: > <mx:HTTPService id="bookData" url="../media/books.xml" > resultFormat="e4x" result="xmlObj = XML(bookData.lastResult)" /> > > When I send the service: > bookData.send(); > the data is sent to this textArea > <mx:TextArea text="{xmlObj.toString()}"/> > > So far so good, however, if I put this other test immediately after the > service call, I'm getting the dreaded NULL reference error. > > trace(xmlObj.stock.(@id == "1").name); > Does this mean I need to check for load completion, like an event > listener on an UrlLoader ? (if so, How? ) > The documentation seems to indicate it shouldn't be neccesary, so I'm > not even sure that's the problem > What's wrong ? > > > The xml is below > <?xml version="1.0" encoding="iso-8859-1"?> > <books> > <stock id="1"> > <name>The Picasso Code</name> > <author>Dan Blue</author> > <category>Fiction</category> > <description>Cubist paintings reveal a secret society > of people who really look like that</description> > </stock> > </books> > > > > > > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]