No sé qué Im que hace mal aquí. Sé que esto no debería ser difícil, pero su me escapaba.
De todas formas, lo que Im tratando de hacer es crear cajas de texto mediante un bucle que lee un XML. Yo iba a usar un valor del XML para el cuadro de texto el nombre de instancia y un valor para, así, el valor de la caja de texto.
He probado el código XML, así que sé que el problema no está ahí. Los dos problemas que he principalmente son: 1) El cuadro de texto no se crea o visualiza mientras que en el bucle (funciona si tomo la mirada hacia fuera) y 2) el cuadro de texto no se mostrará el valor XML cuando se utiliza el XML para dar el cuadro de texto un valor. Si, por ejemplo, acaba de llamar gato, y asignarle el valor del XML funciona, pero cuando trato de utilizar el XML para dar al texto un nombre de instancia y luego le da el valor del XML no funciona.
Heres mi AS:
var nav:XML = new XML();
nav.load("nav.xml");
nav.onLoad = startXML;
nav.ignoreWhite = true;
function startXML(){
rootNode = nav.firstChild;
fileLength = rootNode.childNodes;
yy =0;
for(i=0;i<fileLength.length;i++){
rage = rootNode.firstChild.attributes.n;
this.createTextField(rage, this.getNextHighestDepth(), yy, 10, 400, 22);
this[rage].html = true;
this[rage].htmlText = rootNode.firstChild.attributes.n;
yy+= 50;
}
}
startXML();
- var nav:XML = new XML();
- nav.load("nav.xml");
- nav.onLoad = startXML;
- nav.ignoreWhite = true;
- function startXML(){
- rootNode = nav.firstChild;
- fileLength = rootNode.childNodes;
- yy =0;
- for(i=0;i<fileLength.length;i++){
- rage = rootNode.firstChild.attributes.n;
- this.createTextField(rage, this.getNextHighestDepth(), yy, 10, 400, 22);
- this[rage].html = true;
- this[rage].htmlText = rootNode.firstChild.attributes.n;
- yy+= 50;
- }
- }
- startXML();
Gracias de antemano por cualquier ayuda ^ _ ^