Hello,
From a XML file I want show the picture & description in the root. The
movie with buttons is in a movieclip. The picture works, but the text
didn’t show.
I hope somebody can help me with this!
Thanks!
Kokx
var XMLDOC:XML = new XML();
XMLDOC.ignoreWhite = true;
XMLDOC.load(“hond.xml”);
XMLDOC.onLoad = function(success:Boolean):Void {
if (success) {
XML1 = XMLDOC.firstChild;
loadMovie(+XML1.firstChild.firstChild.firstChild, _root.container);
description.text = XMLDOC.firstChild.childNodes*.childNodes[1].firstChild;
}
};
i = 0;
function doit() {
i++;
if (XMLDOC.firstChild.childNodes*.firstChild.firstChild == undefined) {
i = XMLDOC.firstChild.childNodes.length;
tex.text = "end of pictures ";
return false;
} else {
loadMovie(+XMLDOC.firstChild.childNodes*.firstChild.firstChild, _root.container);
description.text = XMLDOC.firstChild.childNodes*.childNodes[1].firstChild;
tex.text = "picture number "+i;
}
}
function doi() {
i–;
if (XMLDOC.firstChild.childNodes*.firstChild.firstChild == undefined) {
i = 0;
tex.text = “end of pictures”;
return false;
} else {
loadMovie(+XMLDOC.firstChild.childNodes*.firstChild.firstChild, _root.container);
description.text = XMLDOC.firstChild.childNodes*.childNodes[1].firstChild;
tex.text = "picture number "+i;
}
}
btnext.onPress = function() {
doit();
};
btprev.onPress = function() {
doi();
};