Comunidad de diseño web y desarrollo en internet online

problema de dysplay de datos xml en flash mx2004

Citar            
MensajeEscrito el 21 Oct 2005 04:46 am
Hola hace tiempo que no me aparecia por aca , pero bueno aqui estoy devuelta, tengo un problema al mostrar los datos en un TextField que flash carga de un xml... les muestro el codigo , haber si notan algo raro (.fla)

Código :

function LeeXML(cargador, textos) {

   text_txt = cargador;
   datos = textos;
   trace("te instancie");
}
//
function cargarDatos() {

   var owner = this;
   var my_xml = new XML();
   my_xml.ignoreWhite = true;
   my_xml.load(datos);
   my_xml.onLoad = function() {
      //trace(this);
      var largo = this.firstChild.childNodes.length;
      trace(largo);
      for (var i = 0; i<largo; i++) {
         var obj = new Object();
         obj.address = this.firstChild.attributes.ADDRESS;
         obj.port = this.firstChild.attributes.PORT;
         obj.name = this.firstChild.childNodes[i].attributes.NAME;
         obj.argValue = this.firstChild.childNodes[i].childNodes[1].attributes.VALUE;
         obj.argValue2 = this.firstChild.childNodes[i].childNodes[0].attributes.VALUE;
         obj.argType = this.firstChild.childNodes[i].childNodes[0].attributes.TYPE;
         obj.argType2 = this.firstChild.childNodes[i].childNodes[1].attributes.TYPE;
         //
         trace(obj.name);
/*
         trace("argument Typo2: "+obj.argType2);
         trace("argument Typo: "+obj.argType);
         trace("argument value: "+obj.argValue);
         trace("nombre del puerto: "+obj.port);
         trace("numero de ip: "+obj.address);
         */
//
         text_txt.htmlText = true;
         owner.text_txt.text = obj.name;
         
         my_mc.loadMovie(obj.argType+".jpg");
      }
   };
}
System.useCodepage = true;
limon = text_txt;
xml = new LeeXML(limon, "test.xml");
cargarDatos();


mi pregunta es como puedo mostrar todos los registros de obj.name en el campo de text_txt, pues en el trace (obj.name) me muestra los registros de cada loop que hace el for en la ventana de output;
en el campo de texto solo me muestra el ultimo registro que es el quinto en mi xml.
si me pueden aconsejar al respecto se los agradeceria mucho,

[moderador]agregada etiquetas code para mejor lectura[/moderador]

Por mmm

26 de clabLevel



 

mozilla
Citar            
MensajeEscrito el 21 Oct 2005 05:14 am
esto no lo entiendo y por deduccion te aseguro que no esta bien

Código :

text_txt.htmlText = true;
owner.text_txt.text = obj.name; 


primero para indicar que escribiras html en un texto dinamico es:

Código :

text_txt.html = true


htmlText es para escribir el contenido html.

Código :

owner.text_txt.text = obj.name;

esta linea si es verdad que ni la entendi, te estas referiendo al mismo texto dinamico de la linea anterior? :?

en tal caso seria

Código :

text_txt.htmlText =obj.name;


ahora con tu duda, supongo que te refieres a concatenar, puedes hacer esto, y ya que pretendes hacer escribiendo con html es algo asi:

Código :

text_txt.htmlText+="<p>"+obj.name+"</p>";



saludos :)

Por Maikel

BOFH

5575 de clabLevel

22 tutoriales
5 articulos

Genero:Masculino   Team Cristalab

Claber de baja indefinida

firefox

 

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