[AC/XML] EDIT V.02 | Image is not loading in Actionscript
Morning guys,
Yesterday I spent hole my day on finding the clue to this problem. The problem is:
The text is loading very well out of the XML but the image is not getting true. Do I have to make a MediDisplay instead of a TextBox? or what do you guys suggest me to do.
btw: At the end I have a list of items and when I click on them I will get to another gallery.
ActionScript
PHP Code:
Main = new XML();
Main.ignoreWhite = true;
Main.onLoad = leesXML;
Main.load("test.xml");
function leesXML(succes) {
if (succes) {
_root.tekstVeldje.text = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.tekstVeldje1.text = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.tekstVeldje2.text = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
}
}
XML
PHP Code:
<?xml version="1.0" encoding="utf-8"?>
<tutorial>
<crew>
<naam>Pietje Klaassen</naam>
<afbeelding>plant.jpg</afbeelding>
<bouwjaar>14-05-1988</bouwjaar>
</crew>
<crew>
<naam> Truusje Klaassen </naam>
<afbeelding> Gebonden </afbeelding>
<bouwjaar> 04-07-1988 </bouwjaar>
</crew>
</tutorial>
Thank you guys for looking at the problem.
Cheers,
Jordy
------------------------------------------- EDIT-------------------------------------------
It worked to load a image in a clean file now I have to create 1 file with those 2
Actionscript
PHP Code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success){
if(success){
// the line below load the pictures in 2 empty movie clips manually created
loadMovie(myXML.childNodes[0].firstChild.firstChild.nodeValue, firstloader);
//loadMovie(myXML.childNodes[1].firstChild.firstChild.nodeValue, secondloader);
} else {
//error loading the XML
}
}
myXML.load("myImage.xml");