# Bringing in a URL from XML file

**URL:** <https://forum.kirupa.com/t/bringing-in-a-url-from-xml-file/324535>\
**Category:** flash\
**Created:** [August 25, 2011, 9:25pm UTC](https://forum.kirupa.com/t/bringing-in-a-url-from-xml-file/324535 "2011-08-25T21:25:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kristen33](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@kristen33](https://forum.kirupa.com/u/kristen33)\
**Post date:** [August 25, 2011, 9:25pm UTC](https://forum.kirupa.com/t/bringing-in-a-url-from-xml-file/324535/1 "2011-08-25T21:25:22Z")

</div>

Hello. I am new to AC3 and I need to have my Flash movie read URL’s dynamically from an XML file.  
I have used this code and applied it to my button(photo\_link\_btn):

photo\_link\_btn.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void {  
navigateToURL(new URLRequest(“**[http://www.yahoo.ca](http://www.yahoo.ca)**”));  
}

It works when I hardcode a URL into the URLRequest line highlighted above. But I am trying to bring in the URL through XML.

Here is an example of the XML data:  
\<?xml version=“1.0” encoding=“utf-8”?\>  
\<photos\>  
\<photo\>  
\<filename\>animals\_400x260\_01.jpg\</filename\>  
\<title\>House\</title\>  
\<description\>Description:\</description\>  
\<link\>[http://www.yahoo.ca](http://www.yahoo.ca)\</link\>  
\</photo\>

Does anyone have any suggestions for me for how I could go about doing this?  
Thanks in advance. 🙂
