# Getting a variable into flash

**URL:** <https://forum.kirupa.com/t/getting-a-variable-into-flash/13548>\
**Category:** Uncategorized\
**Created:** [February 14, 2003, 3:11pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548 "2003-02-14T15:11:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbay](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@gbay](https://forum.kirupa.com/u/gbay)\
**Post date:** [February 14, 2003, 3:11pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/1 "2003-02-14T15:11:28Z")

</div>

hi all,  
i’ve done a search for this on the forum but havnt found what i needed.  
i have an html drop down box on my html page. i also have my flash movie on the same page. i’ve got an onChange handler on my drop box which calls a functions that sets a variable. how can i get that variable into my movie without having to reload the page?  
hope that makes sense.

- gBay

---

<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 14, 2003, 4:33pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/2 "2003-02-14T16:33:57Z")

</div>

you can do it with javascript.

window.document.MOVIEID.SetVariable(“VARIABLE”, “VALUE”);

where MOVIEID is the id specified in the “id” attribute of the object tag for your flash movie.

---

<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 17, 2003, 10:02am UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/3 "2003-02-17T10:02:24Z")

</div>

hi, thanks for answering my question, but…  
but will i be able to keep changing the value of the variable within the movie without having to reload the page?

- gbay

---

<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 17, 2003, 2:15pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/4 "2003-02-17T14:15:32Z")

</div>

you can change it all you like without reloading.

the only problem is it won’t work in all browsers.

---

<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 17, 2003, 3:27pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/5 "2003-02-17T15:27:49Z")

</div>

change the variable values without reloading page? thats wicked! which browsers will it not work in? if its fine on ie4 / ns 4.7 and above then thats fine, if not, then thats a problem. Why wouldnt it work in some browsers? do some not support javascripts SetVariable command?  
thanks

- gBay

---

<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 17, 2003, 3:42pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/6 "2003-02-17T15:42:17Z")

</div>

here’s the macromedia technote.

[http://www.macromedia.com/support/flash/ts/documents/java\_script\_comm.htm](http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm)

it pretty much spells everything out.

---

<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 17, 2003, 3:47pm UTC](https://forum.kirupa.com/t/getting-a-variable-into-flash/13548/7 "2003-02-17T15:47:51Z")

</div>

ah yes! just read the technote. told me all i needed to know.  
cheers for the direction!

- gBay.
