Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2008, 11:33
eduvivi
 
Fecha de Ingreso: enero-2002
Mensajes: 349
Antigüedad: 22 años, 3 meses
Puntos: 1
Imprime solo ultimo valor del Array. PQe?

Estoy trayendo 6 valores de un XML.

Si les hago un trace me los imprime bien todos, pero si los meto en un campo de texto dinamico solo me imprime el ultimo valor del array.

:::: CODE :::::

//load in XML
var XMLcontent:XML = new XML();
XMLcontent.ignoreWhite = true;
XMLcontent.load("test_xml.xml");

//init TextArea component
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite = true;
myText.ignoreWhite = true;

//load css
myNewStyle = new TextField.StyleSheet();
myNewStyle.load("test_style.css");
myText.styleSheet = myNewStyle;

//This code is for select one of the specific node
XMLcontent.onLoad = function(success) {
if (success) {


//It define how many nodes we have.
var num:Number = XMLcontent.firstChild.childNodes.length;
trace("NUM: --- "+num);

//Print all names
var names_array:Array = new Array();
for (var i=0; i<num; i++){
var pics = XMLcontent.firstChild.childNodes[i].attributes.nombre;
myText.text = "Nombre: "+pics+ " \n";
trace("NOMBRES: "+pics);
}
}
};



::::: XML :::::

<links>
<link nombre="Main" ref="home.html"/>
<link nombre="Pictures and Videos" ref="#">
<inLink nombre="Image Gallery" ref="pictures.html"/>
<inLink nombre="Photoshop Tutorial" ref="photoTut.html"/>
</link>
<link nombre="Programming" ref="#">
<inLink nombre="XML flash tutorial" ref="xmlflash.html"/>
<inLink nombre="Flash games" ref="flashgames.html"/>
</link>
<link nombre="3D Design" ref="#">
<inLink nombre="Blender 3D" ref="blender.html"/>
<inLink nombre="3D Studio" ref="3dStudio.html"/>
<inLink nombre="Lightwave" ref="lightwave.html"/>
</link>
<link nombre="University" ref="photoTut.html"/>
<link nombre="LW Plugin" ref="tvplugin.html"/>
</links>

Gracias de antemano

Última edición por eduvivi; 26/01/2008 a las 13:29