# Setting Flash variables from Javascript

**URL:** <https://forum.kirupa.com/t/setting-flash-variables-from-javascript/56726>\
**Category:** flash\
**Created:** [July 7, 2004, 5:53am UTC](https://forum.kirupa.com/t/setting-flash-variables-from-javascript/56726 "2004-07-07T05:53:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariachi77](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mariachi77](https://forum.kirupa.com/u/mariachi77)\
**Post date:** [July 7, 2004, 5:53am UTC](https://forum.kirupa.com/t/setting-flash-variables-from-javascript/56726/1 "2004-07-07T05:53:34Z")

</div>

Does anyone know the correct syntax for setting a variable on \_root using Javascript?

The Macromedia site says:

\<!-- javascript

movie.SetVariable("/:varname", “varvalue”);

However, this notation is quite old. I haven’t been able to get it to work. Anyone with experience here?

Cheers,

Mike

---

<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:** [July 7, 2004, 6:17am UTC](https://forum.kirupa.com/t/setting-flash-variables-from-javascript/56726/2 "2004-07-07T06:17:26Z")

</div>

Instead of using Flash 4 notation to manipulate root variables, I simply had to name the variable:

movie.setVariable(“name”, “value”);
