# Load vars from javascript to flash

**URL:** <https://forum.kirupa.com/t/load-vars-from-javascript-to-flash/99330>\
**Category:** Uncategorized\
**Created:** [January 17, 2004, 2:49pm UTC](https://forum.kirupa.com/t/load-vars-from-javascript-to-flash/99330 "2004-01-17T14:49:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustinM](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JustinM](https://forum.kirupa.com/u/JustinM)\
**Post date:** [January 17, 2004, 2:49pm UTC](https://forum.kirupa.com/t/load-vars-from-javascript-to-flash/99330/1 "2004-01-17T14:49:44Z")

</div>

I did some searching and wasn’t able to find a thread that helped me with an answer. I’m trying to give a friend a hand with his project and could use a bit of direction. We are trying to pass a string of variables and values from an html page to a flash project. We’re using javascript to put the variables and values into a string named queryvar. We are able to view the string using a javascript alert box at the time that it should be passed to flash. Now here’s where I can’t figure out where the problem lies…I’m not sure if we’re passing the string to the flash movie properly. The html embed tags are as follows:

document.write(’\<PARAM NAME=movie VALUE=“pie\_chart.swf?’ + queryVar + '”\>’);  
document.write(’\<PARAM NAME=FlashVars VALUE="’ + queryVar + ‘"\>’);  
document.write(’\<EMBED src=“pie\_chart.swf?’ + queryVar + '” FlashVars="’ + queryVar + ‘"…  
document.write(’\</EMBED\>’);

We are using Loadvars in flash to try to grab the string:  
//calc\_step3.htm is the file that has the swf embedded  
var c = new LoadVars();  
c.load(“calc\_step3.htm”, 0, “GET”);

I try using parseint to parse the string but get NaN error.  
If anyone has a good way to test this or any suggestions please let me know. Thank you!
