douluo1330 2010-07-22 17:29
浏览 33
已采纳

Flex 3(Actionscript)查询数据网格的记录集数组

Hey, all. I am building an application in Flex Builder 3. Yes, I know that it has an auto-magic feature to build datasheet, but that will not work. I see many Flex controls, such as combo box, can take an array as a data source.

My question, therefore, is (1) How do I send the request from my action script to my PHP form to request a record set. (2) Presuming that my dataset is in a PHP assoc array, how do I format it to send it back to Action Script. (3) How do I take the data received from the recordset, and put it inot an actionscript array, suitable for use as a data source.

I can connect to my database in PHP, and query it just fine, so I don't need help with that. For consistency, and humor, lets presume that I have the following data in an assoc array that I pulled from a database.

Array ( [0] => Array ( [name] => Kirk [shirt] => Gold [assign] => Bridge )

[1] => Array ( [name] => McCoy [shirt] => Blue [assign] => Sick Bay )

[2] => Array ( [name] => Scotty [shirt] => Red [assign] => Engineering )

[3] => Array ( [name] => Spock [shirt] => Blue [assign] => Bridge )

[4] => Array ( [name] => Uhura [shirt] => Red [assign] => Bridge )

[5] => 1 )

  • 写回答

2条回答 默认 最新

  • dongyun3335 2010-07-22 18:32
    关注

    I find it easier to send a request that retrieves the data from the PHP in XML format. Then inside the Flex application, turn it into an ArrayList and use it with your controls.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 VS2022创建MVC framework提示:预安装的程序包具有对缺少的注册表值的引用
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义
  • ¥15 嵌入式--定时器使用
  • ¥20 51单片机学习中的问题
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题
  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库