# How to pass query variables to swfobject?

**URL:** <https://forum.kirupa.com/t/how-to-pass-query-variables-to-swfobject/270989>\
**Category:** web dev\
**Created:** [September 17, 2008, 5:57am UTC](https://forum.kirupa.com/t/how-to-pass-query-variables-to-swfobject/270989 "2008-09-17T05:57:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonnieraymond](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bonnieraymond](https://forum.kirupa.com/u/bonnieraymond)\
**Post date:** [September 17, 2008, 5:57am UTC](https://forum.kirupa.com/t/how-to-pass-query-variables-to-swfobject/270989/1 "2008-09-17T05:57:45Z")

</div>

Hi, please help me with this issue:  
How can I pass the query variable string like this:

```auto
http://www.mysite.com/index.html?var1=value&anothervar=value&other=value

```

into swfoject:

```auto
<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.addVariable("variable1", getQueryParamValue("variable1")); // This is static which doesn't help, I want it to be dynamic!!!
   so.write("flashcontent");
</script>

```

‘addVariable’ is a static method and it doesn’t help when users add dynamic query string in the url. I want a solution to pass every value of the query string to ‘addVariable’ dynamically.  
How can I do that?  
Thanks!!!
