# Dynamic XML URL linking

**URL:** <https://forum.kirupa.com/t/dynamic-xml-url-linking/225652>\
**Category:** flash\
**Created:** [May 14, 2007, 6:29pm UTC](https://forum.kirupa.com/t/dynamic-xml-url-linking/225652 "2007-05-14T18:29:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemasterjg](https://avatars.discourse-cdn.com/v4/letter/l/a698b9/32.png) [@lemasterjg](https://forum.kirupa.com/u/lemasterjg)\
**Post date:** [May 14, 2007, 6:29pm UTC](https://forum.kirupa.com/t/dynamic-xml-url-linking/225652/1 "2007-05-14T18:29:18Z")

</div>

hey all,

h’m having a few problems with getting URLs form an XML file to attach to the images that are fed into flash through XML. one part if the problem is taht i can’t seem to convert the images into a button, the next would be linking the URLs that each one has those buttons.  
XML code:

\<?xml version=“1.0” ?\>  
\<links\>  
\<link image = “3dbuzz.jpg” URL = “[www.3dbuzz.com](http://www.3dbuzz.com)”/\>  
\<link image = “hotlinks.jpg” URL = “[www.hotlinks.com](http://www.hotlinks.com)”/\>  
\<link image = “kirupa.jpg” URL = “[www.kirupa.com](http://www.kirupa.com)”/\>  
\<link image = “tutorialized.jpg” URL = “[www.tutorialized.com](http://www.tutorialized.com)”/\>  
\<link image = “gotoandlearn.jpg” URL = “[www.gotoandlearn.com](http://www.gotoandlearn.com)”/\>  
\<link image = “dreamhost.jpg” URL = “[www.dreamhost.com](http://www.dreamhost.com)”/\>  
\<link image = “flashkit.jpg” URL = “[www.flashkit.com](http://www.flashkit.com)”/\>  
\<link image = “raph.jpg” URL = “[www.raph.com](http://www.raph.com)”/\>  
\<link image = “cgtalk.jpg” URL = “[www.cgtalk.com](http://www.cgtalk.com)”/\>  
\<link image = “3dtotal.jpg” URL = “[www.3dtotal.com](http://www.3dtotal.com)”/\>  
\</links\>

A.S. 2.0 code:

xmlLinks = new XML();  
xmlLinks.ignoreWhite = true;  
xmlLinks.onLoad = function(success) {  
link = this.firstChild;  
linklength = link.childNodes.length;  
for (i=0; i\<linklength; i++) {  
linkImage = this.firstChild.childNodes\*.attributes.image;  
linkURL = this.firstChild.childNodes\*.attributes.URL;  
newPiece = sliderholder\_mc.attachMovie(“template”, “piece”+i, i);  
newPiece.\_y = i\*25;  
newPiece.holder\_mc.loadMovie(“images/links/”+linkImage);  
}  
};  
xmlLinks.load(“links.xml”);
