Bom, indo direto ao ponto...

Para você passar um parametro utilizando o remoteObject com AMF3 no
amfphp você pode fazer assim:

meuservico.getOperation('getEndereco').send(param1, param2, param3);

voilá!!!



On 19 jul, 11:45, João Saleiro <[EMAIL PROTECTED]> wrote:
> Neste endereço:http://www.riapt.org/tiki-view_blog_post.php?blogId=1&postId=91
> tens um exemplo de Flex 2 com AMFPHP. :)
>
> João Saleiro
>
> Andrey Wischneski wrote:
> > Ta aí um exemplo bem simples de como eu faço, veja se pode te ajudar...
>
> > Flex:
> > <?xml version="1.0"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> > <http://www.adobe.com/2006/mxml>" layout="absolute">
> >     <mx:Script>
> >         <![CDATA[
> >             import flash.net.NetConnection;
> >             import flash.net.ObjectEncoding;
> >              import flash.net.Responder ;
> >             import mx.controls.Alert;
> >             public var conexao:NetConnection;
> >             public var protocol:String =
> > ExternalInterface.call("window.location.protocol.toString");
> >             [Bindable]
> >              public var site:String =
> > protocol+"//"+ExternalInterface.call("window.location.hostname.toString");
> >             public function getString(str:String):void
> >             {
> >                 this.conexao = new NetConnection;
> >                  this.conexao.objectEncoding = ObjectEncoding.AMF0;
> >                 var hostname:String =
> > protocol+"//"+ExternalInterface.call("window.location.hostname.toString
> > ")+"amfphp/gateway.php";
> >                 this.conexao.connect(hostname);
> >                 this.conexao.call("serviceclass.retornaString",new
> > Responder(returnString, onFault),str);
> >             }
> >             public function returnString(resultado:String):void
> >             {
> >                 Alert.show("Sucesso, " + resultado);
> >             }
> >             public function onFault(erro:Array):void
> >             {
> >                 Alert.show("Erro: " + erro);
> >             }
> >         ]]>
> >     </mx:Script>
> >     <mx:Panel width="250" height="114" layout="absolute" x="224"
> > y="263" title="Teste">
> >         <mx:TextInput x="10" y="10" width="210" id="TextInput"/>
> >         <mx:Button x="155" y="40" label="Enviar" click="getString(
> > TextInput.text);"/>
> >     </mx:Panel>
> > </mx:Application>
>
> > AMFPHP, serviceclass.php:
> > <?
>
> > class serviceclass
> > {
>
> >     public function serviceclass()
> >     {
>
> >         include(" serviceclass.methodTable.php");
>
> >     }
>
> >     /**
> >     * Retorna uma string pré formatada
> >     *
> >     * @access remote
> >     * @param string str Uma string qualquer
> >     * @return string
> >     */
> >     public function retornaString($str)
> >     {
> >         return "Voce digitou: $str";
> >     }
>
> > }
> > ?>
>
> > On 18/07/07, * [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>*
> > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>
> >     Olá pessoal, gostaria de saber como passo parametros do flex para o
> >     amfphp.
>
> >     exemplo:
>
> >     [FLEX]
> >     eu gostaria de passar um ID e tenho uam funcao pronta no php para
> >     retornar um objeto.
>
> >     meuservico.getOperation ('getEndereco').send();
>
> >     como adiciono parametros para o php ?


--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para [EMAIL PROTECTED]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---

Responder a