# Call images from xml file based on url

**URL:** <https://forum.kirupa.com/t/call-images-from-xml-file-based-on-url/254596>\
**Category:** random\
**Created:** [March 13, 2008, 1:46pm UTC](https://forum.kirupa.com/t/call-images-from-xml-file-based-on-url/254596 "2008-03-13T13:46:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcyone](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@alcyone](https://forum.kirupa.com/u/alcyone)\
**Post date:** [March 13, 2008, 1:46pm UTC](https://forum.kirupa.com/t/call-images-from-xml-file-based-on-url/254596/1 "2008-03-13T13:46:05Z")

</div>

I am a newbie to actionscripting and sure could use some help on this:

I need to embed a flash banner on pages that call images from a xml file based on the url of the page, i.e. if a person is on the “research page” I would want the movie to parse the images from the research gallery in the xml and pass it to actionscript (I think)…

The xml gallery looks like this:

\<gallery library=“PUBLICATIONS” timer=“5” order=“sequential” fadetime=“2” looping=“yes” xpos=“0” ypos=“0”\>  
\<image path=“images/image1.jpg” /\>  
\<image path=“images/image2.jpg” /\>  
\<image path=“images/image3.jpg” /\>  
\</gallery\>

\<gallery library=“RESEARCH” timer=“5” order=“sequential” fadetime=“2” looping=“yes” xpos=“0” ypos=“0”\>  
\<image path=“images/image4.jpg” /\>  
\<image path=“images/image5.jpg” /\>  
\<image path=“images/image6.jpg” /\>  
\</gallery\>

* * *

I snagged this javascript to get the url from a javascript on the html page:

\<script type=“text/javascript”\>  
var theURL = document.location.href;  
document.write(’\<h1\>’ + theURL + ‘\</h1\>’);  
\</script\>

* * *

Questoin is:

How do I get the variable passed to the actionscript to parse the url and therefore load the appropriate image within the movie. I appreciate any help!
