I think I’m in big trouble.
I am reading a xml, and it is working perfect.
But entered 4 new parameters in the XML,<subtotal>,<currency>,<TotalWeight> and <WeightUnit>, and I can not read them.
XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<cart>
<subtotal>999999,99</subtotal>
<currency>R$</currency>
<TotalWeight>133,23</TotalWeight>
<WeightUnit>kg</WeightUnit>
<item>
<image>ModStetsomM.jpg</image>
<prod>Módulo de Potência 2 Canais CL50</prod>
<qty>2</qty>
<price>159,59</price>
</item>
</cart>
AS:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
item = [];
valor = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
item* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
valor* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
}
firstImage();
} else {
content = "não carregou!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
preco_txt.text = valor[0];
item_txt.text = item[0];
picture_num();
//ValorTotal_txt.text;
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Does anyone know how I can solve?