Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/02/2009, 16:00
Avatar de Lynxcraft
Lynxcraft
 
Fecha de Ingreso: noviembre-2007
Ubicación: yecla murcia
Mensajes: 1.346
Antigüedad: 16 años, 5 meses
Puntos: 51
crear componentes desde un php

hola amig@s bueno aqui tengo una duda aver si me pueden ayudar XDXD

bueno el caso es que quisiera saber si se pueden crear componentes en un php y devolverlos al swf flex por ejemplo tengo este codigo
Código PHP:
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    backgroundColor="#FFFFFF"
    backgroundAlpha="0">

    <mx:Script>
        <![CDATA[ 
            import mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            import mx.controls.Alert;
            import mx.controls.ComboBox
            
            public function ValoresOk(event:ResultEvent):void
            {
                this[event.result.toString()];
            }
            
            public function ValoresNo(event:FaultEvent):void
            {
                Alert.show(event.fault.faultString, "Error");
            }
        ]]> 
    </mx:Script>
    
    <mx:HTTPService id="valores"
        url="http://localhost/n/prueva.php"
        result="ValoresOk(event)" 
        fault="ValoresNo(event)" 
        resultFormat="e4x">
        <mx:request>
            <ncodigo>{codigo.text}</ncodigo>
            <nvalor>{valor.text}</nvalor>
        </mx:request>
    </mx:HTTPService>
    <mx:TextInput id="codigo" 
        x="130" y="32" 
        width="160" height="22" />
    <mx:TextInput id="valor" 
        x="130" y="58" 
        width="160" height="22" />
    <mx:Button x="130" y="95" 
        label="Enviar" 
        click="valores.send()" 
        width="160" height="22" />
            
    
</mx:Application>
y en el php de prueba esta esto


Código PHP:
<?

    
function CreaNuevoComponente($codigo$valor) {

        
$options "<mx:".$codigo." label=\"".$valor."\" ></mx:".$codigo.">";
        return 
$options;
    }
 
$options CreaNuevoComponente($_REQUEST[ncodigo], $_REQUEST[nvalor]);

     print 
'<?xml version="1.0" encoding="utf-8"?> ';
     print 
"<contenedor>";
     print 
$options ;
     print 
"</contenedor>";
?>

parece que las variables llegan bien al php lo malo es que me da este error


Error #1083: El prefijo "mx" del elemento "mx:Button" no está vinculado.

aver si alguien me guia para crear componentes atraves del php XDXD aun me queda mucho por saber esto del flex XDXD

gracias
__________________
Sobran las ideas cuando faltan ganas de trabajar en ellas
Lynxcraft