0

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 )

Gregor Kiddie
  • 3,119
  • 1
  • 19
  • 16
Don Briggs
  • 715
  • 6
  • 11

2 Answers2

1

I would look into :

http://www.amfphp.org

or

http://www.themidnightcoders.com/products/weborb-for-php/overview.html

reidLinden
  • 4,020
  • 4
  • 31
  • 46
0

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.

Jage
  • 565
  • 4
  • 10
  • OK, how do I do that without any external libraries? – Don Briggs Jul 22 '10 at 22:20
  • Adobe has a pretty good example using the HTTPService component in Flex with PHP example code included: http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html – Jage Jul 23 '10 at 13:22
  • My boss did not want to add any new libraries. So this was the best way. You are right, the example is pretty good. thank you. – Don Briggs Jul 28 '10 at 16:12