millirules
09-26-2006, 12:58 PM
Hi! I'm beginnig with flash & Xml, and I've a problem. I'm trying to attach Xml nodes in a document with actionscript. This is my script, where "promociones" is the array where i want to attach the new node. I can make the node, but I cant attach it to the array. Can anybody help me??
Thank you!
function aņadeNodo(id, corX, corY) {
var valoresNew;
var nuevoNodo:XMLNode = promociones.createElement("nuevoNodo");
nuevoNodo = prom_actual.cloneNode(true);
valoresNew = nuevoNodo.childNodes;
trace(nuevoNodo);
valoresNew[0].firstChild.nodeValue = id;
valoresNew[1].firstChild.nodeValue = corX;
valoresNew[2].firstChild.nodeValue = corY;
promociones = comunidades[0].childNodes;
promociones.appendChild(nuevoNodo);
trace (promociones);
}
Thank you!
function aņadeNodo(id, corX, corY) {
var valoresNew;
var nuevoNodo:XMLNode = promociones.createElement("nuevoNodo");
nuevoNodo = prom_actual.cloneNode(true);
valoresNew = nuevoNodo.childNodes;
trace(nuevoNodo);
valoresNew[0].firstChild.nodeValue = id;
valoresNew[1].firstChild.nodeValue = corX;
valoresNew[2].firstChild.nodeValue = corY;
promociones = comunidades[0].childNodes;
promociones.appendChild(nuevoNodo);
trace (promociones);
}