hi!
i dont know flash and xml:) but i need understand about ‘how extract words from xml to flash’.
look
i have flash file, where i write this code:
var offers = [["", 0], ["", 0]];
function loadXML(fileName) {
var fileName:String;
album = new XML();
album.onLoad = handleLoad;
album.ignoreWhite = true;
album.load(fileName);
}
function handleLoad(success) {
if (success) {
for (var count01 = 0; count01<album.childNodes.length; count01++) {
main = this.childNodes[count01];
for (var count02 = 0; count02<main.childNodes.length; count02++) {
var myid = Number(main.childNodes[count02].attributes.id);
offers[myid-1][0] = main.childNodes[count02].attributes.destination;
offers[myid-1][1] = main.childNodes[count02].attributes.price;
}
}
offer1 = offers[0][0];
price1 = "£ "+offers[0][1];
offer2 = offers[1][0];
price2 = "£ "+offers[1][1];
play();
} else {
output = “Attempt load XML failed”;
//displayError();
}
}
loadXML(“destinations.xml”);
stop();
also i have first xml file:
<?xml version=“1.0” encoding=“utf-8”?>
<offers>
<direction name=“food”>
<offer id=“1” destination=“Mirgorod” price=“11”/>
<offer id=“2” destination=“Kiev” price=“12”/>
</direction>
</offers>
and second xml file:
<?xml version=“1.0” encoding=“utf-8”?>
<offers>
<offer id="1" destination="Mirgorod" price="11"/>
<offer id="2" destination="Kiev" price="12"/>
</offers>
so, second xml file working with flash file, but first no:(
who can help me?
thank you so much!!!
pls look my attachmend
so, i want repeat task again
flash must working with first xml file