hello, i tried this tutorial: http://www.kirupa.com/developer/actionscript/xmldataflash.htm
That was about displaying text in flash through xml. But how do i do the same with [COLOR=Red]images/pictures[/COLOR]?
This is what i tried, but i couldent get the [COLOR=Red]picture[/COLOR] to work (just the text worked)
(if you wonder, the word “[COLOR=SeaGreen]bilde[/COLOR]” means “[COLOR=SeaGreen]image[/COLOR]”)
Here is my xml tekst:
<?xml version="1.0" encoding="utf-8"?>
<innhold>
<person>
<tittel>tittel</tittel>
<ingress>ingress</ingress>
[COLOR=Red]**<bilde>image.jpg</bilde>**[/COLOR]
</person>
<person>
<tittel>tittel 2</tittel>
<ingress>ingress2</ingress>
</person>
</innhold>
here is my actionscript:
function loadXML(loaded) {
if (loaded) {
_root.tittel = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.ingress = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
**[COLOR=Red]_root.bilde = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;[/COLOR]**
tittel_txt.text = _root.tittel;
ingress_txt.text = _root.ingress;
[COLOR=Red]**bilde1_txt.text = _root.bilde;**[/COLOR]
_root.tittel2 = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
_root.ingress2 = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
tittel2_txt.text = _root.tittel2;
ingress2_txt.text = _root.ingress2;
} else {
trace("dosn't load");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("tekst.xml");
what do i do wrong?