I think you want to use x.response.data.lookups.lookup[0].id

 

I find the best way to debug this sort of issue (well, first you need to assume it is something wrong with your ActionScript) is to take Flex, HTTPService and lastResult out of the equation and try to write an E4X _expression_ against a local XML var.

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of bobpardoe1959
Sent: Thursday, June 29, 2006 10:54 AM
To: [email protected]
Subject: [flexcoders] Re: E4X & XML - what is going here ? - Please advise

 

If i put _service.lastResult[0] in the watch _expression_ I get the
following

_service.lastRequest[0]=<request>
+ <parameters>
+ (the others)
+ <duration>

If I change the expresssion to be _service.lastResult[0].duration, I
get the following

_service.lastResult[0].duration = <errors during evaluation>
+ no such variable: duration

Hope this helps, the text above might not be 100% reflective of the
xml below, but it is close enough

Thanks

BOb

--- In [EMAIL PROTECTED]ups.com, "Peter Farland" <[EMAIL PROTECTED].> wrote:
>
> When you say "won't evaluate", can you provide more detail? Do you get a
> runtime error?
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of bobpardoe1959
> Sent: Thursday, June 29, 2006 8:29 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] E4X & XML - what is going here ? - Please advise
>
>
>
> I have a response coming back from an HTTPService call in e4x format
> as shown below.
>
> In the debugger I can get to a lookup node by doing
> _service.lastResult[0][0][0][0].id or something similar.
>
> What I would expect to do is
> _service.lastResult.response.data.lookups[0].id but this wont evaluate.
>
> What am I doing wrong ?
>
> I have tried casting the results to both an XML and XMLList variables
>
> Using flex 2 release version
>
> Thanks
>
> BOb
>
> <root>
> <response name="GetLookup" language="en-UK">
> <request>
> <parameters>
> <parameter value="*" name="seedValue"/>
> <parameter value="GetLookup" name="action"/>
> <parameter value="user_types" name="controller"/>
> </parameters>
> <starttime>29 Jun 2006 13:15:44</starttime>
> <endtime>29 Jun 2006 13:15:44</endtime>
> <duration>0.0</duration>
> </request>
> <status>
> <code>OK</code>
> <message/>
> </status>
> <errors/>
> <data>
> <lookups>
> <lookup>
> <id>6</id>
> <col1>code 1</col1>
> <col2>Code 1 name ---------X</col2>
> </lookup>
> <lookup>
> <id>15</id>
> <col1>code 10</col1>
> <col2>Code 10 name ---------X</col2>
> </lookup>
> </lookups>
> </data>
> </response>
> </root>
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to