Comunidad de diseño web y desarrollo en internet online

[object AsyncToken]

Citar            
MensajeEscrito el 01 Jul 2008 08:08 pm
Tengo un problema que me tiene de puntas:

Estoy con flex y php mediante webORB

En flex:

Con un textinput envio a una funcion una variable mediante un boton.
Tengo otro textinput para que reciba otra variable.

En php:
Una funcion que tiene variable de entrada un nombre y retorna ese mismo nombre para mostrarlo en flex.

Codigos:

Codigo Flex helloword.xml

Código :

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
    <![CDATA[

        import mx.rpc.events.FaultEvent;
        import mx.rpc.events.ResultEvent;
        
        private function onResult(event:ResultEvent):void{
            trace("<<>>",event.result)
        }
        private function onFault(event:FaultEvent):void{
            trace("ERROR: ",event.fault.faultString)
        }
      private function nombre(name:TextInput):void{
         salida.text=Service.login(name);
         
      }

    ]]>
</mx:Script>

   <mx:RemoteObject
      id="Service"
      destination="GenericDestination"
      source="HelloWorld"
      showBusyCursor="true"
      
      result="onResult(event);"
      fault="onFault(event);"
   />
   <mx:Label x="33" y="20" text="Nombre:"/>
   <mx:TextInput x="94" y="18" id="entrada"/>
   <mx:Button x="276" y="18" label="Button" click="nombre(entrada)"/>
   <mx:Label x="33" y="154" text="Su nombre es:"/>
   <mx:TextInput x="124" y="152" id="salida"/>
</mx:Application>


Codigo Flex helloworld.php
(copie del tutorial, por eso hay helloworld, pero no lo estoy ocupando, es para conservar el nombre)

Código :

<?php
class HelloWorld
{

    public function testMethod()
    {
        return 7;
    }

    public function helloWorld()
    {
       return "hello world";
    }
   public function login(string $usuario)
   {
      return $usuario;
   }
}

?>


Espero que me ayuden[/code]

Por fernandexen

16 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 02 Jul 2008 10:52 pm

Código :

private function onResult(event:ResultEvent):void{
       trace("<<>>",event.result)
}


La respuesta sale en tu output, no en tu campo de texto

Por eldervaz

BOFH

10964 de clabLevel

39 tutoriales
56 articulos

Genero:Masculino  

en algún lugar del mundo

clabbrowser

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.