# Trying to pass a string var from html url

**URL:** <https://forum.kirupa.com/t/trying-to-pass-a-string-var-from-html-url/310595>\
**Category:** flash\
**Created:** [June 14, 2010, 4:28pm UTC](https://forum.kirupa.com/t/trying-to-pass-a-string-var-from-html-url/310595 "2010-06-14T16:28:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [June 14, 2010, 4:28pm UTC](https://forum.kirupa.com/t/trying-to-pass-a-string-var-from-html-url/310595/1 "2010-06-14T16:28:12Z")

</div>

So, I want to pass a string variable to a SWF so that I can specify a XML file to load without republishing the SWF. When I assign the string variable to a textfield it is correct. But when I use that variable in the loader it does not display the XML from that file. You can see below that I commented out the string “lesson\_11/images/0301\_objectives.xml”. If I put this string in the loader it works, if I use the string variable in its place it does not work. Can anyone see what I am doing wrong? Thanks in advance.

```auto

var xmlFileToLoad:String;
var myQueryString:Object;
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
function loaderComplete(myEvent:Event)
{
 var myQueryString = stage.loaderInfo.parameters.xml_file;
 
 xmlFileToLoad = "lesson_11/images/0301_objectives.xml";
 txtTryPassVar.text =xmlFileToLoad;
}
 
loader.load(new URLRequest(xmlFileToLoad));//"lesson_11/images/0301_objectives.xml"

```
