Apache flex 我必须循环搜索特定值的结果吗?

Apache flex 我必须循环搜索特定值的结果吗?,apache-flex,actionscript-3,Apache Flex,Actionscript 3,我在数据库中有一个表: name Opinion Tim Tim has an opinion John other random text Dan Dan's random text Al Al says something else 我调用这些数据并将其返回 getRecords.lastResult 要获取John的意见,我可以使用: getRecords.lastResult[1].opinion

我在数据库中有一个表:

name         Opinion
Tim          Tim has an opinion
John         other random text
Dan          Dan's random text
Al           Al says something else
我调用这些数据并将其返回

getRecords.lastResult
要获取John的意见,我可以使用:

getRecords.lastResult[1].opinion
但那只是因为我知道约翰是第二个记录1,但这可能会改变。所以正确的方法是搜索结果,首先找到John的记录索引,然后访问他的意见


我想我需要某种循环?有没有一种更简单的方法可以不用循环直接搜索John?

如果getRecords返回n条记录,John必须在其中一条记录上 您可以在As3中执行此操作,并在Arraycollection周围执行循环,直到找到John为止


在给定搜索字符串john(如果唯一)的情况下,执行一些服务器逻辑以返回john数据。

JSON、XML、E4X等格式的响应是什么?