# AS2 Flash 8: Getting a parameter into a string?

**URL:** <https://forum.kirupa.com/t/as2-flash-8-getting-a-parameter-into-a-string/225317>\
**Category:** flash\
**Created:** [May 10, 2007, 5:09pm UTC](https://forum.kirupa.com/t/as2-flash-8-getting-a-parameter-into-a-string/225317 "2007-05-10T17:09:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crapitoutjim](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@crapitoutjim](https://forum.kirupa.com/u/crapitoutjim)\
**Post date:** [May 10, 2007, 5:09pm UTC](https://forum.kirupa.com/t/as2-flash-8-getting-a-parameter-into-a-string/225317/1 "2007-05-10T17:09:54Z")

</div>

Hi There,

I have a movie clip which has a function on it that loads some xml (actually xml that is created on the fly by php). The problem is that I have several different parameters - 3 in total which have to be tagged on to the URL so that the xml can display correctly.

I have no problem getting the first 2 parameters into the URL, but I cannot get the final one. On the \_root I can trace it fine via another function however I can’t get the parameter from the function that lies on the \_root, into the URL that sits in another movie clip.

Am I making any sense?

This is what I have for the code that sits in the movie clip:

[COLOR=“Gray”]//load vars for product info[/COLOR]  
[COLOR=“Blue”]var[/COLOR] sendProduct\_lv:[COLOR=“Blue”]LoadVars[/COLOR] = new [COLOR=“Blue”]LoadVars/COLOR;  
[COLOR=“Blue”]var[/COLOR] prodID:[COLOR=“Blue”]Number[/COLOR];  
[COLOR=“Blue”]var[/COLOR] popUpUrl:[COLOR=“Blue”]String [/COLOR]= [COLOR=“SeaGreen”]“[http://www.mysite.com/xml.php?data=product&id=](http://www.mysite.com/xml.php?data=product&id=)”[/COLOR]

[COLOR=“Gray”]//declare load popup function[/COLOR]  
[COLOR=“Blue”]function[/COLOR] floadPopup(prodID, pageNumber) {  
[COLOR=“Blue”]trace[/COLOR]([COLOR=“SeaGreen”]"Your Page Number is: "[/COLOR]+page\_mc.pageNumber);  
sendProduct\_lv.action = [COLOR=“SeaGreen”]“product”[/COLOR];  
sendProduct\_lv.brochureID = [COLOR=“Blue”]\_root[/COLOR].broID;  
sendProduct\_lv.dataInt = prodID;  
sendProduct\_lv.[COLOR=“Blue”]sendAndLoad[/COLOR]([COLOR=“SeaGreen”]“actions.php”[/COLOR], sendProduct\_lv, [COLOR=“SeaGreen”]“POST”[/COLOR]);  
[COLOR=“Gray”]//defines the xml object[/COLOR]  
[COLOR=“Blue”]var [/COLOR]xmlData = [COLOR=“Blue”]new XML/COLOR;  
//ignores white space in the xml  
xmlData.[COLOR=“Blue”]ignoreWhite [/COLOR]= [COLOR=“Blue”]true[/COLOR];  
[COLOR=“Gray”]//on load event for the xml, must be defined here and not after the xml itself has been loaded[/COLOR]  
xmlData.[COLOR=“Blue”]onLoad [/COLOR]= processXMLData;  
[COLOR=“Gray”]//finally loads the xml file[/COLOR]  
xmlData.[COLOR=“Blue”]load/COLOR;  
[COLOR=“Blue”]trace/COLOR;  
}

And this is the code I have for the function that allows me to trace the page number on the \_root of my file:

myBook\_mc.onPutPage = [COLOR=“Blue”]function[/COLOR](pageNumber, page\_mc){  
[COLOR=“Blue”]trace[/COLOR]([COLOR=“SeaGreen”]"Your Page Number is: "[/COLOR]+page\_mc.pageNumber);  
}

What I am trying to do is get the URL that is declared in the first function after xmlData.load to have page=2 or 3 or whatever page I hppen to be on when the function floadPopup is invoked.

Hope this makes sense, any help would be really appreceated as I am having huge headaches with this, thanks in advance.

Cheers :{
