# Link to pdf from xml

**URL:** <https://forum.kirupa.com/t/link-to-pdf-from-xml/312296>\
**Category:** Uncategorized\
**Created:** [July 29, 2010, 11:43pm UTC](https://forum.kirupa.com/t/link-to-pdf-from-xml/312296 "2010-07-29T23:43:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneesh\_rec](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@aneesh\_rec](https://forum.kirupa.com/u/aneesh_rec)\
**Post date:** [July 29, 2010, 11:43pm UTC](https://forum.kirupa.com/t/link-to-pdf-from-xml/312296/1 "2010-07-29T23:43:10Z")

</div>

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

```auto
<?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…

```auto
//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…
