我有HTTPservice
id="myhttp"
url="site.com/script.php"
method="POST"
resultFormat="xml"
它使用的脚本返回
$output = '<worked>' . $worked . '</worked>';
echo $output;
问题是当我尝试阅读worked
时,它告诉我变量worked
不存在
event.result.worked
myhttp.lastResult.worked
唯一有效的方法是使用toString()
myhttp.lastResult.toString()
or event.result.toString()
我做错了什么?
time
,因此需要分别访问每个time
和worked
。 worked
和time
值。我怎么做。我当时想不使用XML。有更轻量级的选择。 Flex显示我有以下选项:array
e4x
flashvars
object
text
xml
答案 0 :(得分:1)
您应该使用e4x作为返回类型。通过将返回类型声明为xml,您可以告诉flex将其作为XMLNode来处理,这是遗留的,不应该使用。
如果由于某种未知原因需要使用XMLNode,可以使用event.result.nodeValue获取文本的值。
答案 1 :(得分:0)
您的退货类型应该是e4x吗?