1

I have an HTTPservice

id="myhttp"
url="site.com/script.php"
method="POST"
resultFormat="xml"

The script it uses returns

 $output = '<worked>' . $worked . '</worked>';
 echo $output;

Problem is when I try to read worked, it tells me the variable worked is not there

event.result.worked
myhttp.lastResult.worked

The only thing that works is using toString()

myhttp.lastResult.toString()
or event.result.toString()

What am I doing wrong?

  • I plan to add other variables to the output time, so need to access each time and worked separately.
  • I may also need to return multiple responses each with their own worked and time values. How do I do that. I was thinking to not use XML. Is there a more lightweight option. Flex shows I have the following options: array e4x flashvars object text xml
tag
  • 3,315
  • 2
  • 16
  • 6
  • Is the XML that comes from the PHP script well formed? I don't see the actual declaration. What's the output of event.result.toString()? – ilikeorangutans May 08 '10 at 17:42

2 Answers2

1

You should use e4x as your return type. By declaring your return type as xml, you tell flex to handle it as an XMLNode, which is legacy and shouldn't be used.

If you need to use XMLNode for some unknown reason, you can get the value of the text by using event.result.nodeValue.

Nyeski
  • 76
  • 1
0

Should your return type be e4x?

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59