2/7/2011 8:29:48 AM
Title:
Returning array from PHP and read it in flex
Hello All
I am new to flex I am having following task.
I am using httpService to send userid to PHP and ,when userid is sent the information with respect to that userid will come in the form of array to flex result event.
Now say, my array contain username, location, company name etc.
and I returned that array by sayin "return $userArray"
Now, How I read that array in flex , whenever i alert the resulet event it it is giving null.
Please Help me in flex as well as in PHP side
ThankYou in advance
2/8/2011 12:50:12 AM
you should first convert the array to comma separated string and then return it to flash.
In flash you can split the comma separated string into array again.
2/8/2011 8:54:38 AM
when passing data between flash and php the data type should be string , other datatypes are not supported so you are getting null in the result. Array returned cannot be parsed by flash. You can only return string data or variable pairs. I mean to say the loaded data in the request can be either loaded as text or sets of variables.
2/8/2011 9:26:30 AM
Hi Shridhar
Please checkout this following link get the answer to your question.
very useful....
http://codezfun.blogspot.com/2011/02/access-remote-database-from-adobe-air.html