I dont use AMFPHP to comunicate with Flex, AMFPHP its a good solution
but I prefer to make all server scripts by myself, also if you send a
 lot of registers to a datagrid in XML format the amount of bytes is
too high, if you send registers in "your propietry way" you send less
data but you have to transform in the client.
Here you have a sample filling a ComboBox:

PHP send this (each line is a register):
field1|field2|field3|....
field1|field2|field3|....
field1|field2|field3|....

At Flex:

hs is a HTTPService instance

private function getResult(event:Event):void{
switch(this.hs.resultFormat){
case 'object':
// In this case the PHP sent one XML
this.dataProvider=hs.lastResult.item;
break;
case 'text':
// In this case PHP sent registers whose fields are separated by '|'
character
if(this.hs.lastResult!=''){
var a:Array=this.hs.lastResult.split('|');
var b:Array=new Array();
for(var x:Number=0;x<a.length;x+=2){
b[b.length]={label:a[x],value:a[x+1]};
}
this.dataProvider=b;
}
break;
}
}







--- In [email protected], "arnold_charming"
<[EMAIL PROTECTED]> wrote:
>
> Hi!
> 
> I'm using php as my server pages while flex is used for presentation
> logic. What bugs me the most is the exchange of data between PHP and
> Flex. I always have to generate a XML file and then passed it to Flex.
> Can this be done any simplier and faster? How about passing mysql data
> results from PHP directly to Flex without the hasle of transforming it
> to XML? Is AMFPHP the right tool for this job?
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to