# Passing variables from loaded swf

**URL:** <https://forum.kirupa.com/t/passing-variables-from-loaded-swf/264733>\
**Category:** Uncategorized\
**Created:** [June 29, 2008, 8:32pm UTC](https://forum.kirupa.com/t/passing-variables-from-loaded-swf/264733 "2008-06-29T20:32:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geestring](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geestring](https://forum.kirupa.com/u/geestring)\
**Post date:** [June 29, 2008, 8:32pm UTC](https://forum.kirupa.com/t/passing-variables-from-loaded-swf/264733/1 "2008-06-29T20:32:54Z")

</div>

so I have menu.swf that uses loadClip to bring in data.swf

Depending on what button is pressed I want menu to read menuHeight = 4600; from data.swf

in data swf I declare the var as \_root.menuHeight = 4600;

and in menu.swf I try to read it as normal. menuHeight.

Shouldnt this work since the \_root. of data.swf is the \_root. of menu.swf?

---

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [July 2, 2008, 3:40pm UTC](https://forum.kirupa.com/t/passing-variables-from-loaded-swf/264733/2 "2008-07-02T15:40:52Z")

</div>

what happens if you read it as \_root.menuHeight instead of just menuHeight?

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [July 2, 2008, 4:40pm UTC](https://forum.kirupa.com/t/passing-variables-from-loaded-swf/264733/3 "2008-07-02T16:40:35Z")

</div>

nop, the var you created is in the \_root.

if it traces undefined, it means the path to it isn’t correct. don’t forget you’re inside a menu, and the variable is in the root of your site…
