# Passing function parameters from an XML doc

**URL:** <https://forum.kirupa.com/t/passing-function-parameters-from-an-xml-doc/244414>\
**Category:** flash\
**Created:** [November 17, 2007, 6:50pm UTC](https://forum.kirupa.com/t/passing-function-parameters-from-an-xml-doc/244414 "2007-11-17T18:50:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clemente](https://avatars.discourse-cdn.com/v4/letter/c/c67d28/32.png) [@Clemente](https://forum.kirupa.com/u/Clemente)\
**Post date:** [November 17, 2007, 6:50pm UTC](https://forum.kirupa.com/t/passing-function-parameters-from-an-xml-doc/244414/1 "2007-11-17T18:50:15Z")

</div>

Hi-

I’m having an issue with calling a function from an imported XML file. This is my function:

function SwitchImage(movieName) {  
this.popBox.popImage.loadMovie(movieName);  
this.popBox.popCaption = “Go Bulldogs”;  
}

This is the XML. The function works fine. It calls the function “SwitchImage” and it loads the image “1.jpg”.

\<myLife \>  
\<pagetext whatYear=“1959”\>I was born on February 4\<a href=“asfunction:\_global.shell.SwitchImage,images/1.jpg”\>change picture\</a\>\</pagetext\>  
\</myLife\>

Now I want to pass it another parameter called “popCaption”:

function SwitchImage(movieName, popCaption) {  
this.popBox.popImage.loadMovie(movieName);  
this.popBox.popCaption = (popCaption);  
}

\<myLife \>  
\<pagetext whatYear=“1959”\>I was born on February 4\<a href=“asfunction:\_global.shell.SwitchImage,images/1.jpg, my new caption”\>change picture\</a\>\</pagetext\>  
\</myLife\>

I’m not sure what I’m doing wrong, but it must be in the XML. Any help is appreciated.  
Thanks,  
Clemente
