# Use a variable in root for nested movieclip

**URL:** <https://forum.kirupa.com/t/use-a-variable-in-root-for-nested-movieclip/290167>\
**Category:** Uncategorized\
**Created:** [June 10, 2009, 7:29pm UTC](https://forum.kirupa.com/t/use-a-variable-in-root-for-nested-movieclip/290167 "2009-06-10T19:29:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kendec9999](https://avatars.discourse-cdn.com/v4/letter/k/e47774/32.png) [@kendec9999](https://forum.kirupa.com/u/kendec9999)\
**Post date:** [June 10, 2009, 7:29pm UTC](https://forum.kirupa.com/t/use-a-variable-in-root-for-nested-movieclip/290167/1 "2009-06-10T19:29:17Z")

</div>

Hello,

I want to use the same movieclip different times (different instances). The only thing that has to change in this movieclip is a string. I tried to solve this creating a variable.

To be more concrete, on root timeline i have

```auto
var RespJpeg:String = "bandlang2.jpg"

```

and inside the movieclip (actually inside a movieclip in a movieclip in a movieclip in a movieclip: 4level nested) i have

```auto
loadImage("RespJpeg")

```

This obviously didn’t work. What i tried was the following:

```auto
loadImage(MovieClip(root)."RespJpeg");

```

```auto
event.currentTarget.root.loadImage(MovieClip(root)."RespJpeg");

```

```auto
loadImage(event.currentTarget.root.String = "RespJpeg");

```

None worked. I’m not sure what I’m doing here. Please help me on the way… How to communicate between root and 4level nested movieclip

thanks  
Ken
