# Passing variables to SWF

**URL:** <https://forum.kirupa.com/t/passing-variables-to-swf/310501>\
**Category:** flash\
**Created:** [June 11, 2010, 2:21pm UTC](https://forum.kirupa.com/t/passing-variables-to-swf/310501 "2010-06-11T14:21:01Z")\
**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 11, 2010, 2:21pm UTC](https://forum.kirupa.com/t/passing-variables-to-swf/310501/1 "2010-06-11T14:21:01Z")

</div>

I have been trying to pass a variable to a SWF. From the research I have done it seems pretty straight forward, but I cannot seem to get it to work. I am wondering if it has something to do with the way the SWF is added to the HTML page. Would someone take a look at this for me? Thanks in advance.

```auto

<p><br />
<div id="mySwf" />
<script type="text/javascript">
 loadSwfToDiv("lesson_11/images/0301_objectives.swf?xml_file=lesson_11/images/0301_objectives.xml", "mySwf", 800, 600)
</script>
</p> 

```

```auto

var xmlFileToLoad:String;
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
function loaderComplete(myEvent:Event)
{
  var myQueryStrings=this.loaderInfo.parameters;
  xmlFileToLoad = myQueryStrings.xml_file;
  trace(myQueryStrings);
}
var myQueryStrings = this.loaderInfo.parameters;
var myOtherMovie:String = myQueryStrings.movieToLoad;

```
