header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
abhishek
Points:0
Posts:0

5/5/2010 4:52:57 AM

Title: how to send arraycollection in php from flex


hey frnd,
how to send arraycollection in php from flex ?
is any solution thr?
thx in advanced,
abhishekchess1@gmail.com
:)



1
Rex
Points: 1180
Posts:0
5/5/2010 5:08:32 AM



sending array collection from flex to php can be achieved by using post request. Which is similar to submitting a form .

While using the post request you can send the data by converting it to xml or some coma separated format which you can decode in php to regenerate the arrycollection in php.

2
abhishek
Points: 0
Posts:0
5/5/2010 5:40:55 AM



hey frnd,
i have arraycollection data like arrcol([label='a',val='1'],...)
so can i fetch in same way(arracol[0].label) in php?

3
Dave
Points: 970
Posts:1
5/5/2010 6:19:22 AM



you can use below function to convert the arrayCollection in to string in flex and then forward this string to PHP, You have to write a code on this string to recreate it to an array collection in PHP.

public static function arrayCollectionToString( myArrayCollection:ArrayCollection ):String
		{
			var collStr:String
			for each( var obj:Object in myArrayCollection )
			{
				collStr += "[";
				for each( var obj2:Object in obj )
				{
					collStr += obj2.toString() + ", ";
				}
				collStr += "]";
			}
			return collStr;
		}


4
Inder
Points: 2880
Posts:0
5/5/2010 6:28:29 AM



when you use httpservice or webservice to send data from flex to PHP or some other server side language. the data types are not exchangeable so they are not preserved . Which means data exchange can be done using strings only. But this is truly not a very efficient way .
Another way is using JSON with flex , check this good tutorial to see see how you can use JSON with flex and PHP to do communication with datatypes preserved
http://www.adobe.com/devnet/flex/articles/flex_php_json.html


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+0 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions