# SetVariable in a nested MovieClip

**URL:** <https://forum.kirupa.com/t/setvariable-in-a-nested-movieclip/65692>\
**Category:** flash\
**Created:** [September 28, 2004, 7:48pm UTC](https://forum.kirupa.com/t/setvariable-in-a-nested-movieclip/65692 "2004-09-28T19:48:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaporo](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@shaporo](https://forum.kirupa.com/u/shaporo)\
**Post date:** [September 28, 2004, 7:48pm UTC](https://forum.kirupa.com/t/setvariable-in-a-nested-movieclip/65692/1 "2004-09-28T19:48:25Z")

</div>

How does one set a variable inside a nested movie clip?

I’ve created a dynamic text box at the root of my movie and given it a var name. It works fine.

However, when I dynamically load an SWF into my main movie using LoadMovie(“myotherfile.swf”) that contains the variable file, it is no longer accessible.

I’ve tried using:

window.document.myMovie.SetVariable("\_root.nestedSWF.myvar", “test”);  
(where nestedSWF is the name of the nested movie clip)

No success. Help on this would be greatly appreciated as always…
