Comunidad de diseño web y desarrollo en internet online

Valores Flash y Php

Citar            
MensajeEscrito el 29 Nov 2008 06:12 pm
//------------------- esta parte ya lo tengo
tengo un campo de texto dinamico:

resultado.text este campo recibe el valor procesado de un php

y tengo un campo llamado acciones.text

este campo es lo que debe hacer

//------------------------------ esta parte me falta

si resultado.text trae el valor 1 , el campo acciones.text debe pintarse "Resultado 1"
y si resultado.text trae el valor 2 , el campo acciones debe pintarse "Resultado 2"

Por zonwebperu

24 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 11 Dic 2008 05:55 pm

Código :

acciones.text = "Resultado " + resultado.text;

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 12 Dic 2008 05:18 am
ha este post lo recuerdo, fue publicado varias veces pero resolvimos el problema en personal via msn, pero nunca publique la solucion, la publico aqui, cualquiera puede reutilizar la parte de flashvars, suerte con sus codigos.

script.as


Código :

function envioDatos( Void ):Void
{
   envio_lv.flash_request = envia_txt.text;
   if( envio_lv.sendAndLoad("datos.php", envio_lv, "POST") )
   {
      recibe_txt.text = "Cargando...";
   }
   else
   {
      recibeDatos( false );
   }   
}
function recibeDatos( exito:Boolean ):Void
{
   if( exito )  
   {
      recibe_txt.text = envio_lv.flash_response;
      if( recibe_txt.text == "1" )
      {
         this.gotoAndStop("gano");
      }
      else if( recibe_txt.text == "0" )
      {
         this.gotoAndStop("perdio");
      }
   }
   else
   {
      recibe_txt.text = "Sin Respuesta";
   }
   this.clean();
}

function setNumber( aux:Number ):Void
{
   if( envia_txt.text.length < 5 )
   {
      envia_txt.text = String( Number( envia_txt.text + String( aux ) ));   
   }
}
function clean( Void ):Void
{
   envia_txt.text = "0";
}

var envio_lv:LoadVars = new LoadVars();
var envia_txt:TextField;
var recibe_txt:TextField;
var borra_btn:MovieClip;
var enviar_btn:MovieClip;
var botones_arr:Array = new Array();
botones_arr.push( this["cero_btn"] );
botones_arr.push( this["uno_btn"] );
botones_arr.push( this["dos_btn"] );
botones_arr.push( this["tres_btn"] );
botones_arr.push( this["cuatro_btn"] );
botones_arr.push( this["cinco_btn"] );
botones_arr.push( this["seis_btn"] );
botones_arr.push( this["siete_btn"] );
botones_arr.push( this["ocho_btn"] );
botones_arr.push( this["nueve_btn"] );

for( var i:Number = 0; i <= 9; i++ )
{
   botones_arr[i].index = i;
   botones_arr[i].onRelease = function( Void ):Void
   {
      this._parent.setNumber( this.index );
   };
}
borra_btn.onRelease = function( Void ):Void
{
   this._parent.clean();
};

enviar_btn.onRelease = function( Void ):Void
{
   this._parent.envioDatos();
};

envio_lv.parent = this;
envio_lv.onLoad = function( exito:Boolean ):Void
{
   this.parent.recibeDatos( exito );
};

this.clean();

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox

 

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