mattpooch
01-13-2009, 10:08 AM
I'm trying to add an HTML link to an XML document that is being displayed in Flash 8 but it's not working...XML and ActionScript are below and images are attached...thanks for your help
XML
<pic>
<image>images/image.jpg</image>
<caption><![CDATA[<a href="www.whatever.com">This is the text that should be linked and displayed.</a>]]></caption>
</pic>
ActionScript
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://www.whatever.com/flash/xml/story_images.xml");
XML
<pic>
<image>images/image.jpg</image>
<caption><![CDATA[<a href="www.whatever.com">This is the text that should be linked and displayed.</a>]]></caption>
</pic>
ActionScript
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://www.whatever.com/flash/xml/story_images.xml");