First of all this is not a repost, i’ve searched the entire section for a solution before posting this.
My situation is that i have a flash site which loads content from xml files. In certain pages i have a list of pdf files for download. I just need to link the pdfs from the xml to the corresponding buttons which are dynamically generated.
This is my xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data[
<!ELEMENT title (comments, image)>
<!ATTLIST title name CDATA #REQUIRED>
<!ELEMENT comments (#PCDATA)>
<!ELEMENT link (#PCDATA)>
<!ELEMENT image (#PCDATA)>
]>
<data>
<title name="Anastasio">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/fund.png</image>
</title>
<title name="Anastasio's car">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/home.png</image>
</title>
<title name="Anastasio's car">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/whowe_2.png</image>
</title>
<title name="Anastasio's car">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/download.jpg</image>
</title>
<title name="Anastasio's car">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/download.jpg</image>
</title>
<title name="Anastasio's car">
<comments>Date:</comments>
<link>http://www.kirupa.com/forum/showthread.php?t=322704</link>
<image>pic/download.jpg</image>
</title>
</data>
and this is my AS…
//Create the XML Object
myXML = new XML()
myXML.ignoreWhite = true
//Load XML file
myXML.load("ExportedXMLs/report_pictures.xml")
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(succes){
if(succes){
var root = this.firstChild
nodes = root.childNodes
link = [];
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes*.attributes.name
subnodes = nodes*.childNodes
this.ref["Comments_txt"+i].htmlText = subnodes[0].firstChild.toString()
this.ref["link"+i].text = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
}
}
} else trace("Error loading XML document")
}
stop()
Now, how to add link to the “holder_mc”+i with “link”+i…???
pls… someone help me to put the link… i’m kind of desperate…