Comunidad de diseño web y desarrollo en internet online

LoadVars

Citar            
MensajeEscrito el 29 Jun 2007 07:24 pm
Hola! :D
He realizado el tutorial de LoadVars, la parte de "Trayendo el contenido completo de una texto."

En los "Archivos del tutorial", el ejemplo tiene botones para texto basico, avanzado.., yo necesitaria saber como hacer muchos botones para texto basico.
Donde tengo que prestar atencion en el codigo para saber agregar mas textos y mas botones?

Por silsil

11 de clabLevel



Genero:Femenino  

msie7
Citar            
MensajeEscrito el 30 Jun 2007 11:14 am
Me puedes pasar el link del post , es que no lo veo, jeje.

Pasamelo y te hecho un vistazo, no obstante si quieres puedo pasarte un archivo ya hecho.

Vale?

Por lineagrafica

189 de clabLevel

1 tutorial

Genero:Masculino  

Diseño, Desarrollador, Marketing

firefox
Citar            
MensajeEscrito el 30 Jun 2007 03:03 pm
Tengo este codigo, pero la unica parte que me interesa es entender lo del texto basico y botones, y no lo de php, sendandload y operaciones matematicas..
Como me doy cuenta para saber que pongo y que saco.

Código :

var btnphpbd:Button;
var btnphpbas:Button; 
var btntxtava:Button; 
var btntxtbas:Button; 
var btnSendAndLoad:Button;
var btnMath:Button;
var fuenteBasico:LoadVars = new LoadVars();
var fuenteAvanzado:LoadVars = new LoadVars();
var fuenteMath:LoadVars = new LoadVars();
var texto:TextField;

texto.html = true;
texto.wordWrap = true;
texto.multiline = true;


fuenteBasico.onLoad = function (exito:Boolean){
   if (exito){
      texto.htmlText= "<p><b>"+this.titulo+"</b></p><br>";
      texto.htmlText+= "<p>"+this.texto+"</p>";
      texto.htmlText+= "<p align='right'><i>"+this.autor+"</i></p><br><br>";      
   } else{
      managerError("fuenteBasico");      
   }
}
fuenteAvanzado.onLoad = function (exito:Boolean){
   if (exito){
      texto.htmlText="";
      for (var i:Number=0; this["titulo"+i]!=undefined;i++){
         texto.htmlText+= "<p><b>"+this["titulo"+i]+"</b></p><br>";
         texto.htmlText+= "<p>"+this["texto"+i]+"</p>";
         texto.htmlText+= "<p align='right'><i>"+this["autor"+i]+"</i></p><br><br>";      
      }
   } else{
      managerError("fuenteAvanzado");      
   }
}

fuenteMath.onLoad = function (exito:Boolean){
   if (exito){
      var acum:Number = 0;
      for (var op in this){
         if (!isNaN(this[op])){
            acum+= Number(this[op]);         
         }
      }
      texto.htmlText = String(acum);
   } else{
      managerError("fuenteAvanzado");      
   }
}





/**** Definicion de todos los eventos onRelease de los botones ****/
btntxtbas.onRelease = btntxtava.onRelease = btnphpbd.onRelease = btnphpbas.onRelease = btnSendAndLoad.onRelease = btnMath.onRelease = function(){
   texto.htmlText = "Cargando informacion, por favor espere...";
   manager(this._name);
}


function manager(name){
   switch (name){
      case "btntxtbas": fuenteBasico.load("txt/texto1.txt"); break;
      case "btntxtava": fuenteAvanzado.load("txt/texto2.txt"); break;
      case "btnphpbas": fuenteBasico.load("http://localhost/tutorial/loadvars/php/articulo.php"); break;
      case "btnphpbd": fuenteAvanzado.load("http://localhost/tutorial/loadvars/php/articulobd.php"); break;
      case "btnSendAndLoad": 
         fuenteBasico.titulo = "Enviar caracteres especiales con loadvars de flash";
         fuenteBasico.texto = "Los caracteres especiales (áéíóúñ) se envian normales desde flash, en php se debe recibir con la funcion utf8_decode, si usas otro lenguaje busca una función similar ;)";
         fuenteBasico.test= "á";
         fuenteBasico.autor= "Maikel";
         fuenteBasico.sendAndLoad("http://localhost/tutorial/loadvars/php/sendAndLoad.php",fuenteBasico,"GET");
         break;
      case "btnMath": fuenteMath.load("txt/variables.txt"); break;
      default: fuenteBasico.load("txt/texto1.txt"); break; 
   }
}

function managerError(name:String){
   texto.htmlText = "No se pudo cargar la data";
   trace("En "+name+" corrige la direccion del archivo fuente o algo más pudo haber pasado, verifica");
}
manager();
stop();

Por silsil

11 de clabLevel



Genero:Femenino  

msie7

 

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