# loadVariables

**URL:** <https://forum.kirupa.com/t/loadvariables/2628>\
**Category:** flash\
**Created:** [February 25, 2002, 1:18pm UTC](https://forum.kirupa.com/t/loadvariables/2628 "2002-02-25T13:18:55Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 25, 2002, 1:18pm UTC](https://forum.kirupa.com/t/loadvariables/2628/1 "2002-02-25T13:18:55Z")

</div>

I have a JavaScript that generates a URL. The only thing left is to pass that “url” variable into Flash. I’m not sure if this is the right method I need to use or not, but these are the lines of ActionScript I’ve been working on…

on (release) {  
loadVariablesNum (“index.html”, 0, “POST”);  
getURL (url, “\_self”, “POST”);  
}

The JavaScript and Flash are both in index.html. I’ve tried several variations to get it to work, but still no luck. Anyone know what the ActionScript code should be to make Flash read the url variable and use that location (like a HTML form) to post it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 25, 2002, 1:41pm UTC](https://forum.kirupa.com/t/loadvariables/2628/2 "2002-02-25T13:41:58Z")

</div>

Well first of all you don’t need post in there. But I’m not all that sure why it wouldn’t work even with the post there. loadVariables should take every variable on the html and load it into Flash.

double check the addressing, double check your Java script

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 2:21am UTC](https://forum.kirupa.com/t/loadvariables/2628/3 "2002-02-26T02:21:14Z")

</div>

I have a JavaScript alert() showing the correct URL. I think the breaking point is Flash isn’t getting the variable (since I tried a test to have Flash output the URL in a text field and nothing is displayed). Any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 6:30am UTC](https://forum.kirupa.com/t/loadvariables/2628/4 "2002-02-26T06:30:33Z")

</div>

on (release) {  
loadVariablesNum (“index.html”, 0, “POST”);  
getURL (url, “\_self”, “POST”);  
}

What is this getUrl at the end? What purpose does it serve?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 1:24pm UTC](https://forum.kirupa.com/t/loadvariables/2628/5 "2002-02-26T13:24:08Z")

</div>

When the user clicks on the button, Flash reads the URL in the loadVariables. Then the getURL uses that variable to process the form.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 2:15pm UTC](https://forum.kirupa.com/t/loadvariables/2628/6 "2002-02-26T14:15:06Z")

</div>

ok… well probebly the problem is you can’t use “url” as a variable name. I think it might be a proprietary word reserved by action script.

If that’s not the problem, then I’m going to have to experiment a little before I can answer this.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 2:56pm UTC](https://forum.kirupa.com/t/loadvariables/2628/7 "2002-02-26T14:56:50Z")

</div>

I thought that could be it too. So I tried changing it (to “posturl”), but it didn’t seem to make a difference. Though I tried again after you mentioned it just to be sure (using “urlvar”) and still no luck.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 3:15pm UTC](https://forum.kirupa.com/t/loadvariables/2628/8 "2002-02-26T15:15:52Z")

</div>

I just tried another test. I initialize the variable before I call the value with loadVariables with…

var urlvar= “test write”;

And the getURL posted “test write.” So the problem is with the loadVariables line in the middle not loading the value. Any ideas?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2002, 3:55pm UTC](https://forum.kirupa.com/t/loadvariables/2628/9 "2002-02-26T15:55:09Z")

</div>

on (release) {  
loadVariablesNum (“index.html”, 0);  
getURL (url);  
}

have you tried it this way?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 27, 2002, 12:11am UTC](https://forum.kirupa.com/t/loadvariables/2628/10 "2002-02-27T00:11:42Z")

</div>

I tried it but the url still doesn’t load into Flash. But this method has worked for you with JavaScript and Flash being on the same page?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 27, 2002, 7:16am UTC](https://forum.kirupa.com/t/loadvariables/2628/11 "2002-02-27T07:16:03Z")

</div>

I’m not all that handy with the javascript thing. I’m hoping that one of my contemporaries will jump in here soon. There are quite a few on this board who have more experience with this sort of thing than I.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 28, 2002, 7:55am UTC](https://forum.kirupa.com/t/loadvariables/2628/12 "2002-02-28T07:55:09Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 1, 2002, 4:59pm UTC](https://forum.kirupa.com/t/loadvariables/2628/13 "2002-03-01T16:59:47Z")

</div>

I finally found the answer using this[JavaScript to Flash communication](http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm#jtfc) example as a guide.

Thanks, though, for taking the time to try and help. I appreciate it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 22, 2002, 5:00pm UTC](https://forum.kirupa.com/t/loadvariables/2628/14 "2002-05-22T17:00:56Z")

</div>

Is there any way of taking the data from an input box in a seperate .swf file and using it in another .swf movie ?
