En mi servicio Service001.php tengo ésto:
Código :
<?php class Service001 {function Service001() {$this->methodTable=array( "Function001"=>array( "description"=>"Function001 - Devuelve la información de una tabla ordenado por NC.", "access"=>"remote",));} function Function001() {$link=mysql_connect('localhost','root',''); mysql_select_db("construrama"); $sql="SELECT * FROM clientes ORDER BY nc";; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) {$a[]=$row;} return $a; mysql_free_result($result); mysql_close($link);}} ?>
Y sin ningún problema recibo en un MovieClip en Flash así:
Código :
onClipEvent(load) {import mx.remoting.Service; import mx.remoting.PendingCall; import mx.rpc.ResultEvent; import mx.rpc.RelayResponder; urlGateway="http://localhost/amfphp/gateway.php"; var myService:Service=new Service(urlGateway,null,"Service001",null,null); var Call:PendingCall=myService.Function001(); Call.responder=new RelayResponder(this,"getData"); function getData(re:ResultEvent):Void {var a1; for(this.a1=0;this.a1<re.result.length;this.a1++) {this._parent.a[this.a1]=re.result[this.a1];} this._parent.b=re.result.length; this._parent.gotoAndStop(26);}}
¿De acuerdo?, ahora, ¿cómo hago para hacerlo al reves?, enviar de Flash a AMFPHP un arreglo. Gracias por su tiempo.
MQ.